Use of Crystal Reports on the web! Select a blog from jeacey

Source: Internet
Author: User
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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.