VS2010 Crystal Report Usage Summary-from installation to use to deployment, there are pictures of the truth _ Crystal Report

Source: Internet
Author: User
Tags blank page visual studio 2010

VS2010 Crystal Report Use summary-from installation to use to deployment, there is a picture of the truth.

Company to do a crystal report on the printing, let me study how to use, a full torment me for several days. Done on the WinForm and web two ways. My development environment is vs2010,vs2010 Crystal Report appeared on the internet is not much, the following will I do the overall process of reporting the following detailed description:

First of all, according to the online prompts to download,

Select and download an installation package:
1 SAP Crystal Reports, version for Visual Studio 2010-
Including a crystal report file with a DLL.

2 SAP Crystal Reports, version for Visual Studio 2010-
The files used in the Crystal Report deployment

3 SAP Crystal Reports runtime engine for. NET Framework 4 (32-bit)

Packages that support only 32-bit systems

4 SAP Crystal Reports runtime engine for. NET Framework 4 (64-bit)

Only 64-bit systems are supported

Because my machine is a 32-bit machine, I only downloaded 1 of them and 3)

Where 1 is installed in the native development environment, 3 is used after release, due to the use of 32-bit machines, the client must install 3 after the release of this Crruntime_32bit_13_0.msi file.

Above is the reference http://www.cnblogs.com/dgjack/archive/2011/09/09/2172240.html

Secondly, make a simple crystal report below,

1 in the WinForm program,

Pay attention to the following two points;

A The running environment cannot be a. NET Framework 4.0 Clinet profile, to change to the. NET Framework 4, the right key property of the selected item can be changed;

B. Add a app.config to the project (this is for the WinForm project), if the Web project is not added, there is a Web.config; add < to this configuration file Startupuselegacyv2runtimeactivationpolicy= "true" >

<supportedruntimeversion= "v4.0" sku= ". netframework,version=v4.0 "/></startup> Note, add such a sentence uselegacyv2runtimeactivationpolicy=" true ".

Used in general WinForm, requires 3 things to operate. The first form, which is used to show the Crystal Report. The second dataset. xsd file, which is used to store the data that the report needs to be displayed, and this is just a frame.

One, this figure is, form forms use Crystalreportviewer to display Crystal Report.

Second, the dataset step, after creating a dataset, right click-> Add, Tableadaptor, the following is the connection string problem no longer repeat.

Complete the dataset as shown in the DataSet as shown:


Third, the RPT report uses, if is the printing single page paper, only in the detailed information layout can.

Action steps: Text objects can be dragged to generate report names, and so on,


The line object is the drawing line, you can right-click, design the object format, the following figure


The figure above needs to display the dynamic numbers, such as the date datatime.

Database field, select Database Expert,


When you're done, note that you want to have the following segments, so drag to the report. In RPT


Single-page reports are available only in the details

Background code; Calling report delivery data

Private Voidbtn_print_click (object sender, EventArgs e)

{

Cr_monitoringservice CR =new Cr_monitoringservice ();

Ds_monitoringservice ds =new Ds_monitoringservice ();

if (ID!= 0)

{

Model = Service. Getmodel (ID);

}

Else

{

MessageBox.Show ("No data not to print");

Return

}

DataRow NewRow;

NewRow = ds. Tables[0]. NewRow ();

newrow["CompanyName"] =model.companyname;

newrow["DateTime"] =model. Datetimex;

newrow["Dutytime"] =model. Dutytime;

......................................

Ds. Tables[0]. Rows.Add (NewRow);

Cr. Setdatasource (DS);

Frm_view Frm = new Frm_view ();

frm. Captionname = "Monitor registration book";

FRM.CR = CR;

frm. ShowDialog ();

frm. Dispose ();

}

form to view the report form

Public Cr_monitoringservice CR;

private void Frm_view_load (Objectsender, EventArgs e)

{

This. Text = Captionname;

Crystalreportviewer1.reportsource = CR;

Crystalreportviewer1.visible = true;

}

Note that there is a sub-report section in the middle


Equivalent to the opposite plus a report

In the details of the Add a section, do a subreport, add in. The parent-child report should have a corresponding field, which corresponds to this field.

The contact of the parent-child report is at the subreport, right click, select, change subreport link


2 Use the same method in the Web, and there are a lot of web descriptions online. This is no longer described here.

Finally, publish

Winform began to say download 3 installed on the client can be.

and Web Publishing, copy these 5 dll files


To the Publish file

The problem arises, both on this computer and as long as it's a PC release. And there will be an error on the server. 360 browser Below is a blank page, and under IE browser is the famous ' bobj ' error, search on the internet related ' bobj ' wrong answer, not for the server.

There were also two DLL conflicts in the middle. Also did not solve.

The type "CrystalDecisions.Web.CrystalReportViewer" also exists in the c:\Windows\assembly \gac_msil\crystaldecisions.web\ 13.0.2000.0__692fbea5521e1304 \crystaldecisions.web.dll "and" c:\Windows\assembly\GAC_MSIL\CrystalDecisions.Web\ 10.5.3700.0__692fbea5521e1304\crystaldecisions.web.dll "in

Now, that's it, after I'm done, I'm releasing it. Please be continued ...

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.