How to load the Crystal Reports on another server in PULL mode

Source: Internet
Author: User
Tags odbc connection

Problem description:

Recently, it involves crystal report development. The original system already has some Crystal Reports, which are placed inServer.Server BExtract data, a new website is now created, located on the serverServer C, You needServerIn the Crystal Report on the websiteWebThe load is displayed on the page. Structure:

 

 

Development Environment: Vs2008, Crystal Report 2008, Windows2003Domain environment

Solution:

1,AnalysisServerRequired for extracting data from the crystal reportODBCBecauseServerThe crystal report in is fromServer BTo extract dataServerRequiredODBCData Source pointServer BIn the database, this work has been completed by the initial creation of the crystal report, here We need to analyze its data source andServer CCreateODBCReference for data sources(Both settings must be consistent). 

First, view the data source used by the server a crystal report.

Go to serverODBCConfigure to analyze the data source

2,InServer CCreate a virtual directory in IIS on the website. ReferenceServerThe folder location of the crystal report.

3,SetServer CMediumODBCData source. The settings here should beServerTheODBCThe corresponding settings are the same. PointServer C.

4,InASP. NETCode. The Code is as follows::

 

 

  Protected   Void Btnsd1ctx_click ( Object Sender, eventargs E)
{

String Repfilepathremoteparamsctx2 = System. Web. httpcontext. Current. server. mappath ( " ../Crystal/crystal report test. rpt " );
Datetime dtime =   New Datetime (); // Here, dtime is the parameter that needs to be input by the test Crystal Report.
Try
{
Dtime = Convert. todatetime (txtbxparam. Text. tostring (). Trim ());
}
Catch (Exception ex)
{
String Ke = Ex. tostring ();
}

This . Crystalreportsource1.reportdocument. Load (repfilepathremoteparamsctx2 );
// Note: nexussql is the ODBC connection name set in the preceding ODBC settings,
This . Crystalreportsource1.reportdocument. setdatabaselogon ( " Userid " , " Password " , " Nexussql " , " Database Name " );
This . Crystalreportsource1.reportdocument. setparametervalue ( " Dateraised " , Dtime ); // Input parameters

This . Crystalreportsource1.databind ();
This . Crystalreportviewer1.reportsource =   This . Crystalreportsource1;

Crystalreportviewer1.autodatabind= False;
This. Crystalreportviewer1.databind ();
Crystalreportviewer1.bestfitpage= True;
}

 

 

 

 

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.