TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jes Sie
736
1.2k
284.3k
Printing RDLC Report Using Asp.net C#
Aug 10 2019 2:44 AM
Hello everyone, hope someone can give me the correct code.
I am trying to print a RDLC report without preview. Below is my code but does not work. The error says "
Exception Details:
System.NotSupportedException: The given path's format is not supported.
"
protected
void
PrintPos(
object
sender, EventArgs e)
{
string
sql =
"spGet_SalesDetails_A4Printing"
;
var dt = GetDataTable(sql);
LocalReport report =
new
LocalReport();
string
path = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
string
fullpath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase).Remove(path.Length - 4) + @
"\PosPrinting\PrintingPos.rdlc"
;
report.ReportPath = fullpath;
report.DataSources.Add(
new
ReportDataSource(
"dsProduct"
, dt));
int
printQty = 2;
for
(
int
i = 0; i < printQty; i++)
{
PrintToPrinter(report);
}
}
I am following this post: https://ashproghelp.blogspot.com/2017/01/how-to-print-directly-without-showing.html
Reply
Answers (
3
)
Developing a Landing page
how to validate a file exists or not in asp.net using C#