Use of Web Crystal Reports.
First
You need to introduce using crystaldecisions. crystalreports. engine in the. aspx. CS file;
Create a. XSD file and A. rpt file. The. XSD file is actually a ing of fields in the dataset created in. aspx. CS. (Can be added or modified ).
Then
In the. aspx. CS file,
ReportDocument OCR = NULL;
Dataset DS = data. getdataset ();
OCR = new r_standardauditprint ();
OCR. setdatasource (DS );
Crvmainview. reportsource = OCR; // crystaldecisions. Web. crystalreportviewer crvmainview report Browser
Second
You must note that in the. aspx text, set some attributes of crystalreportviewer,
<Table id = "tab4le1" Height = "100%" cellspacing = "2" cellpadding = "2" width = "100%">
<Tr>
<TD valign = "TOP" id = "m_printpage"> <font face = ""> <CR: crystalreportviewer id = "crvmainview" runat = "server" width = "350px" enabledrilldown = "false" displaytoolbar = "false" displaygrouptree = "false" Height = "50px"> </Cr: crystalreportviewer> </font>
</TD>
</Tr>
</Table>
Last Call (JavaScript) in the. aspx btnprint. onclick event) Function printpage (m_printpage) { VaR newstr = Document. All. Item (m_printpage). innerhtml; VaR oldstr = Document. Body. innerhtml; Document. Body. innerhtml = newstr; window. Print (); Document. Body. innerhtml = oldstr; Return true; } Print finished! |
|
|
|