Click here to Skip to main content
15,905,563 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
I used crystal report for my report in asp.net,c#

when I run my report paget i recieve eeror for printing me report,who can i solved it?
thanks

this is my code for print reprt
C#
protected void report_Click(object sender, EventArgs e)
    {

      
        ReportDocument rd = ConfigureCrystalReports();
        rd.PrintOptions.PrinterName = "HP LaserJet M1522n";
        rd.PrintToPrinter(1, false, 0, 0);
    }


and ther error is:
Error 1 The name 'ConfigureCrystalReports' does not exist in the current context C:\Users\venus\Desktop\new\Report.aspx.cs 74 29 C:\...\new\
Posted
Comments
Kenneth Haugland 7-Aug-12 13:14pm    
You didnt specify the name of the new document?
Xavi Giqwa 7-Aug-12 13:25pm    
u can use your report viewer from the toolbox. then bind your report to it. run it then export to a pdf file. print from there
veusk 7-Aug-12 13:26pm    
before page_load I define
ReportDocument rd = new ReportDocument();
and I add in bellow namespace at the first

using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
veusk 7-Aug-12 13:30pm    
when i click on report viewr from toolbox ,notwork and do referesh page
how can i bind my reportr to it?
Xavi Giqwa 7-Aug-12 13:38pm    
click on the little tab on the right hand corner of the report viewer and select the report

1 solution

XML
<body>
    <form id="form1" runat="server">
    <div>

    </div>
    <asp:scriptmanager ID="Scriptmanager1" runat="server"></asp:scriptmanager>
    <rsweb:ReportViewer ID="ReportViewer1" runat="server">
    </rsweb:ReportViewer>
    </form>
</body>
</html>

try this and add ur click on the vviewer tab to seletc ur report
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900