9CBS community discussion about crystal reports

xiaoxiao2021-03-06  40

9CBS - Expert Outpatient Close Window Main Taste: Experience and Data on Crystal Reports, Welcome colleagues who have used crystal reports to sum up, experience, experience in the process of use! ! Author: FOXTOO (Alibaba and forty stolen) Credit value: 100 Forum: .NET technology ASP.NET problem points: 0 Reposted: 64 Posted: 2003-6-10 23:04:39 Information:

Crystal reports in ASP.NET (on)

Www.dotnet8.com 2002-9-6 dotnet

[Html] In our crystal report in VS.NET, the wake-up core is fear, the hips, the hips, the embarrassment, the gantry, the jeans, Yue, Hulu, EB, is very curiosity. After a week, after reading a large number of "Howto" documents, we successfully added some simple report to our ASP.NET program and got some small decisions.

This article teaches you how to use crystal reports in .NET web applications, you can also let you take less detours during your study. In order to get the best results, readers should best have some basic ASP.NET access to database knowledge and experience using VS.NET.

Introduction

Crystal reports can be obtained from a number of methods, one is to create using VS.NET, which provides a very rich model to operate attributes and methods at runtime. If you are using VS.NET development .NET program, you don't need to install other software, because he is already in vs.net.

advantage:

The vs.net crystal statement has some of the main advantages:

Quick report development

Ability to export complex interactive charts

Can be used in WebForm with other controls

It is possible to dynamically export the report into .pdf, .doc, XLS, HTML, RTF, etc.

structure:

Some components form a two-layer structure of the crystal report, and the web applications needed:

Client:

The client only requires an auditor that can access the embedded ASPX page report.

Server:

- Crystal Report Engine (Crengune.dll))

Through it can complete some tasks, such as merging data in the report file, the conversion report is other formats. It is also because of the role of the report engine, the Crystal Report in ASP.NET can be converted into ordinary HTML format.

- Crystal Report Designer (CRDESigner.dll))

The crystal report is created in the designer, in the designer you can design the title, insert data, formula, chart, sub-report, etc.

--.Rpt report file

The first step in the implementation report is to create this report at the Crystal Report Designer interface, and Microsoft has provided some ready-made .rpt examples in the default installation.

- Data Source

The way the .rpt file acquisition database depends on your method's choice, you can choose to make the crystal report you choose to select the data yourself without any code or you can also select manually assembled DataSet, and then transfer it to the report file.

- Crystal Report View Control (Crystal Report Viewer Web Form Control (CRWEBFORMVIEWER.DLL))

Crystal Report View control is a WebForm control that can be regarded as a container that stores reports in the .aspx page. Note: In some complex operations, the report server and the web server may not be on the same physical host, the web server transmits the HTTP request to the report server. Crystal reports can also be performed when WebService is performed. Execution mode

Crystal report data can be implemented using the following method:

- PULL mode:

When the request is requested, the crystal report directly connects the database directly to the database and assembles this data.

- Push mode:

At this time, the development table has to write code connection data and assemble the DataSet, and transfer it to the report. In this case, by using connection sharing and limiting the size of the record set, the report performance can be maximized.

Report type:

Crystal Report Designers can directly contain reports to engineering and can use separate report objects.

- Strongly-Typed report:

When you add the report file to the project, it turns into a "strongly-type" report. In these cases, you will have the power to create the object of the report, which will reduce some code and provide some performance.

- UN-TYPED report:

The report here is not directly included in the project, so it is called the 'UN-TYPED' report. In this case, you have to establish an instance using the "ReportDocuemt" object of the crystal statement, and "manual" manual apipe.

Other considerations

- Although the Crystal Report Viewer has some cool features, such as zoom, page navigation, etc. But he does not provide print function, you have to call the printed function of the visitors.

- Crystal report in vs.net If no registration, then it can only use 30 times, 30 times, "save" can not be used again. To avoid this, you are not in http://www.crystaldecisions.com/ here. (It seems that it is not a case, it seems that it can be used for a long time, but it is not supported)

- The default installed crystal report can only support 5 users, in order to support more users, you have to purchase licenses in http://www.crystaldecisions.com/.

Let us feel it ---- use a ready-made crystal report file in ASP.NET

1) Drag the Crystal Report Viewer from the WebForm toolbar to the .aspx page.

2) Match the properties window of the Crystal Report Viewer Control

3) Click the [...] button to view the "Data Binding" property and pop up the DataBinding window.

4) Select "Report Source" from the "Bindable property" area of ​​the left.

5) Select the "Custom Binding Expression" radio button, specify the file name and path of the.rpt file in the window on the bottom of the right, for example: "C: // Program Files // Microsoft Visual Studio.Net//crystal Reports // Samples // Reports // General Business // World Sales Report.rpt ", then" OK "

Note: The file "World Sales Report.rpt" file is created during VS.NET installation. If you specify another directory during the installation process, you'd better confirm the correctness of the path.

The above steps is actually inserted into the following code to the ASP.NET file:

as well as:

ID = "CrystalReportViewer1"

Runat = "server" width = "350px" Height = "50px" reportource = '">

Note: The style generated by ReportSource in the code in the code in my vs.net official version of the flying knife is not like this, it is:

Reportsource = "" "

This is wrong, there will be an error message, there are two errors:

You must manually modify it in accordance with the format described in this article, which is also a BUG of VS.NET.

6) Call the DataBind method in the Page_Load method. (Code is VB.NET)

Private sub page_load (byval sender as system.object, byval e as system.EventArgs)

DataBind ()

End Sub

7) Save and compile your page. Now, you have a WebForm page for embedded crystal reports.

Note: In the actual development, an error that cannot be accessed in the INETSRV directory will appear at the beginning, and the solution is to change the security properties of its directory, so that the user user has writable permissions. Flying knife I found that the solution from the .NET system has been useless, or it may be the reason I use the Windows.NET operating system.

[/ Html]

Reply to: foxtoo (Alibaba and forty stolen) () reputation: 100 2003-6-10 23:04:53 Score: 0 ASP.NET Water Report (middle)

Www.dotnet8.com 2002-9-6 dotnet

[Html] use PULL mode

We will pass the following steps to perform crystal reports through the PULL mode.

1. First create the RPT file and set some must-have data connections using the Crystal Report Design Interface.

2. Drag and drop a CrystalReportViewer control to the ASPX page, set its properties to specify the.rpt file we created in the previous step.

3. Call the DataBind method in the code.

Create a .rpt file:

1) On right-click "Solution Over", select "Add" - Add New Items in the pop-up menu -> "Crystal Report" -> "Crystal Report"

2) Select "As the Blank Report" radio button in the Crystal Report Library, and finally click OK.

3) The crystal report designer will pop up here.

4) Right-click Details Zone, select "Database" -> "Add / Delete Database ..."

5) In the "Database Expert" pop-up, the OLE DB (ADO "option is expanded, and another" OLE DB (ADO) window will pop up.

6) In the OLE DB (ADO "pop-up window, select" Microsoft Ole DB Provider for SQL Server "and" Next "

7) Specify the information of the connection

Server: Aspcn (What is your machine written?

User ID: SA

password:

Database: PUBS

8) Click "Next" and finally click the "Finish" button.

9) At this point you can see the database we have selected in the Database Expert window.

10) Extend the "PUBS" database, extend the "table", select the "Stores" table and add it to the "Selected Table" area, click the "OK" button.

11) Now displaying the table you selected in the "Database Field" area in the Field Source Browser, as well as the fields in the table.

12) Drag and drop the desired field to enter the "Detail" area of ​​the report. The field name will automatically appear in the "Header" area. If you want to modify the header, you can right-click the text in the Header area, select the Edit Text Object option and edit. 13) Save so that we have a crystal report file.

Create a CrystalReportViewer control

14) Go back to WebForm, drag and drop a Crystal Report Viewer control to the page.

15) Tune the properties window of the Crystal Report Viewer control, select the "DataBindings" area Click [...]

16) In "Crystal Report Viewer Data Binding Window", select "ReportSource" in the "Bonitable Properties" on the right, and select the "Custom Binding Expression" in the lower right corner to specify the .rpt file path.

17) At this point you can see the preview of report files that use some virtual data in the Crystal Report Viewer control.

Note: In the above example, CrystalReportViewer can call real data directly when design, because the data has been saved. In this case, when the data is not saved, he cannot display data when it is not saved. Instead, this is to show some virtual data, and only real data is selected only when executed.

Code Behind program design

18) Call the DataBind method in the Page_Load method.

Execute your program

19) Create and run your program!

You can now use some of the features built into the WEB page, such as page navigation, zoom, and so on.

[/ Html]

Crystal report in ASP.NET (below)

Www.dotnet8.com 2002-9-6 dotnet

[HTML] We use the following steps to perform crystal reports using the Push mode:

Design a DataSet

2. Create a .rpt file simultaneously assign it to the DataSet established in the previous step.

3. Drag and drop a CrystalReportViewer control in the ASPX page to connect to the previous RPT file.

4. Access the database in your code and save the data into DataSet

5. Call the DataBind method.

Design a DataSet

1) Right-click "Solution Browser", select "Add" - "Add New Item" -> "Data Set"

2) Drag and drop the "Stores" table in "SQL Server" in Server Explorer ".

3) There will be a structural diagram of a Stores table in the data set.

--. only contains a structural diagram in .xsd file, there will be no data in it.

Create a .rpt file:

4) Creating this file using the methods described above, the only difference is to use the data set to replace the front direct connection data.

5) After establishing the .rpt file, right click on "Details" -> Add / Remove Database.

6) In the Database Expert window, expand "Project Data" (instead of previous OLEDB), expand "ADO.NET Dataset" - "Dataset1", select "Stores" table.

7) Add "Stores" table to "Selected Table", click "OK"

8) Create a WebForm using the method in PULL mode

Create a Crystal Report Viewer control

9) Establish a Crystal Report Viewer control and set its properties, which is consistent with the PULL mode.

Code Behind code:

10) Use the subunies below in the Page_Load method:

VB.NET code:

Sub bindreport ()

Dim myconnection as new sqlclient.sqlconnection () MyConnection.connectionstring = "server = (local) / netsdk; data = pubs; trusted_connection = yes"

Dim MyCommand as new sqlclient.sqlcommand ()

Mycommand.connection = myconnection

Mycommand.commandtext = "SELECT * from Store"

Mycommand.commandtype = commandtype.text

Dim myda as new sqlclient.sqldataadapter ()

Myda.selectcommand = myCommand

DIM MYDS AS New DataSet1 ()

'This is the DataSet we used in design patterns.

Myda.Fill (MyDS, "Stores")

'You have to use the same name as you in front of DataSet.

Dim ORPT AS New CrystalReport1 ()

'Crystal report binding

ORPT.SetDataSource (MYDS)

'Setting a crystal report ReportSource

CrystalReportViewer1.Reportsource = ORPT

End Sub

C # code:

Private void bindreport ()

{

String strProvider = "server = (local); database = pubs; uid = sa; pwd =";

CrystalReport1 Ocr = New CrystalReport1 ();

DataSet1 DS = New DataSet1 ();

SqlConnection myconn = new SqlConnection (STRPROVIDER);

Myconn.open ();

String strasel = "select * from stores";

SqldataAdapter myadapter = new sqldataadapter (strsel, myconn);

Myadapter.Fill (DS, "Stores");

Ocr.SetDataSource (DS);

This.CrystalReportViewer1.Reportsource = OCR;

}

Note: In the code above, you have to pay attention to the ORPT is a report file of "strongly typed". If you need to use the "untyped" report, you have to use the ReportDocument object, and then call the report file.

Run your program.

11) Run your program

Export report files into other formats

You can export report files into the following format:

PDF (Portable Document Format)

1. 2. DOC (MS Word Document)

2. 3. XLS (MS Excel Spreadsheet)

3. 4. HTML (Hyper Text Markup Language - 3.2 Or 4.0 Compliant)

4. 5. RTF (Rich Text Format) Export Reports with PULL Mode

When the file using the PULL mode is exported, the crystal report accurately opens the required data, the following is the code to perform the export function:

C # code:

VB.NET code:

Private sub button1_click (byvale as system.object, byval e as system.eventargs) Handles Button1.click

Dim myreport as crystalreport1 = new crystalReport1 ()

'Note: Here we build a Strong-type crystal report instance.

DIM DISKOPTS as crystaldecisions.shared.diskfileDestinationOptions = new crystaldecisions.shared.diskFileDESTINATIONOPTIONOS ()

MyReport.ExportOptions.exportDestinationType = crystaldecisions. [Shared] .exportDestinationType.Diskfile

'The option is also required when exporting into other files.

'Such as Microsoft Exchange, MAPI, etc.

MyReport.exportOptions.exportFormattype = crystaldecisions. [shared] .exportformattype.portabledocformat

'Here we export becomes .pdf format file, you can also choose other types of files above.

Diskopts.diskFileName = "c: /output.pdf"

'If you don't specify an exact directory, the file will be saved to the [Windows] / system32 directory.

MyReport.exportOptions.DestinationOptions = Diskopts

'Crystal Report file does not contain a direct filename property, so you can't specify the file name saved directly.

'So you have to use the DiskFileDestinationOptionOptions object, set its diskfilename properties

'For the path you want, finalize the DestinationSoptions attribute of the crystal report as the above DISKFILEDESTINATIONOTIONOption

myreport.export ()

'The code above will complete the export work.

End Sub

Export Crystal Reports using a PUSH mode

When the exported report is established by the PUSH mode, the first step is to establish a connection and assemble the DataSet, set the setDataSource attribute of the report. Then there is a PULL mode in the steps below.

[/ Html]

Top Reply to: FoxToo (Alibaba and forty stolen) () reputation: 100 2003-6-10 23:06:08 Score: 0 .NET environment Crystal Report Summary

Crystal report is an excellent report development tool. When you develop a general management system, all reports use crystal reports. It is simple, easy to use and powerful, and the author is loved, and the use of crystal reports will be presented to everyone.

First, when using the own crystal report, please register, otherwise you can only use 30 times.

Crystal Report Registration Code

Registration number: 6707437608

Password: AAP5GKS0000GDE100DS

Second, use CrystalReportViewer to preview

The CrystalReportViewer control allows you to view Crystal Report in your application. The ReportSource property is used to set which report to see. After this property setting, the report is displayed in the viewer. The source of the report can be the pathDocument, the path of the report file, or a strong type report. 1. Open Toolbox and drag a CrystalReportViewer to the form and we name RPTVEW.

2. Adjust the Windows Form View to the desired size and move it to the desired position by dragging operation.

3. When running the application, the report will be displayed in the viewer.

Third, create new reports

1. Point "Add" and click Add New Item.

2. In the Add New Items dialog box, select Crystal Report from the Template area, name RPTClient, click Open.

3. In the Crystal Report library, choose one of the following options:

· Use report experts - Guide you to complete the creation process of the report and add your choice to Crystal Report Designer.

· As a blank statement - open the Crystal Report Designer.

· From the existing report - create a new report, which is the same as the designated other report.

Note that the Crystal Report library contains many experts to guide you to complete the creation of several specific types of reports. You may want to use an expert to create an initial report to determine which report construct method is suitable for your needs.

4. Click the "OK" button.

If you choose to use the Report Expert, the Report Experts dialog box appears and has a data resource manager. Select the required data for each folder, complete the operations on the Interface of the Report Experts, and then click Finish to access Crystal Report Designer and your report.

Fourth, is it necessary to dynamically set the data source?

Crystal Reports is connected to a database via a database driver. Each driver is written to handle specific database types or database access technologies.

Pull and push model

In order to provide developers with the most flexible data access method, the Crystal Reports database driver is designed to provide a pull-up and push model that can provide data access.

Pull-up type

In the scaffold, the driver will connect to the database and "pull" "to" "" "as needed. When using this model, the SQL commands that are connected to the database and the SQL commands executed in order to obtain data are also processed by the Crystal Reports itself, and the developer is required to write code. Use the pull model if you do not need to write any special code at runtime.

Push model

Instead, the push model requires the developer to write code to connect to the database, execute the SQL command to create a recordset or data set that matches the fields in the report, and passes the object to the report. This method allows you to share the connection into the application and filter data before Crystal Reports receives data.

Fourth, from the ADO.NET data set production report

Create a dataset object from the database

1. Create a new architecture file in the project:

a. In the Solution Explorer, right click on the project name, point to Add, and then click Add New Item.

b. In the "Category" area of ​​the Add New Item dialog, expand the folder, then select "Data".

c. Select "Data Set" in the Template area.

d. Accept the default name dataset1.xsd.

This creates a new architecture file (DataSet1.xsd), which will use it to generate strong type datasets. The architecture file will be displayed in the ADO.NET Dataset Designer.

2. Specify the database location: a. In the Server Explorer, right-click "Data Connection" and select Add Connection.

b. In the Data Link Properties dialog box, click the Provider tab and select a provider (such as Microsoft Ole DB Provider for SQL Server).

c. Click the Connection tab and specify where your database is located. Enter the server and login information in the desired position.

d. Click the "OK" button.

At this point, your database and its tables and fields appear under the "Data Connection" node of the Server Explorer.

3. In the Solution Explorer, double-click DataSet1.xsd (if it is not an activity view).

DataSet1.xsd should now be displayed in the Dataset tab.

4. To establish a schema for the Data Set, drag the required tables from the Server Explorer to the Dataset1.xsd "Datase" tab.

5. Click "Save Dataset1.xsd" to save the "DataSet1.xsd" file.

6. On the Generate menu, click Generate to generate a dataset object for the project.

ADO.NET Dataset Object provides data description, from it to Crystal Report adds a table. Add a table from the ADO.NET dataset object using the "Database Expert" in Crystal Report Designer.

Please call "Database Expert" when you use the Report Experts to create a new report. Alternatively, to access the "Database Expert" from a report that has already been established using ADO.NET, right-click in Report Designer, point to "Database", and then click Add / Remove Database.

Connect the report to the ADO.NET dataset object

1. In the Database Expert, expand the Project Data folder.

2. Expand the "ADO.NET Dataset" folder.

3. Select the desired data set object.

For example, if it is used at the time of the architecture file "Dataset1.xsd" from the project "WindowsApplication1" schema file, "WindowsApplication1.DataSet1" should be selected.

4. Select the table you want to add to the report and use other data sources.

5. Dynamically change the code of the data source

DIM DSDataSet As New Dataset ()

Dim orpt as new rptclient () 'established report RPTCLIENT

Please read the reader to fill the data set on your own DSDataSet

'Use the Report Engine Object Model to pass the data set to the report

ORPT.SETDATASOURCE (DSDataSet.tables (0))

'Bind the report object with data to the Windows Form Viewer, RPTVEW (CrystalReportViewer Control)

RPtVew.Reportsource = ORPT

Note that the FillDataSet method can connect to the specified database, extract the data, and disconnect the database connection. If you want to add multiple tables in the database to the report, use the SQL JOIN statement to connect these tables together; then specify a result table in the FillDataSet method

6. Creating a master from a report

In the report, there are many reports that the primary slave table structure, such as orders and order items, the order is a record in a table, and the entry is a plurality of records in another table, and the two tables are associated with one field. This report can be implemented using its packet function.

1. New project

2. Add a CrystalReportViewer control to Form1 3. Connect to the Northwind database connected to SQL Server 2000 in the Service 噐 Explorer.

4. Add a dataset DataSet1 to add the Orders and Order Details in the Server Explorer to the data set.

5. Add a crystal statement, use the report expert, select "ADO.NET Dataset" in the project data, insert table Order Details, "Link" is the link to the associated field, in the Field, select The fields of the primary table and the schedule, the selection group in the group is based on the Orders Table ORDERSID field, the total, chart, and select (screens), the style (which can be set), can be set. After setting, click Finish.

6. Adjust the position, width of the field that needs to be displayed in the report designer.

7. Add code in the window.

Private Sub Form1_Load (Byval E AS System.Object, Byval E AS System.Eventargs) Handles MyBase.Load

Dim ORPT AS New CrystalReport1 ()

DIM DSDataSet As New Dataset1 ()

Dim cn as new data.sqlclient.sqlConnection ("data source = pmserver; initial catalog = northwind; user ID = sa; password = sa")

Cn.open ()

Dim daorders as new data.sqlclient.sqldataadapter ("SELECT * from Orders", CN)

Daorders.Fill (DSDataSet, "Orders")

Dim Dadetails as new data.sqlclient.sqldataadapter ("Select * from [Order Details]", CN)

Dadetails.Fill (DSDataSet, "Order Details")

'Use the Report Engine Object Model to pass the data set to the report

ORPT.SetDataSource (DSDataSet)

CrystalReportViewer1.Reportsource = ORPT

End Sub

8, run the program

7. Use the program to change the text of the text in the report.

code show as below:

DIM GetTextObject As TextObject

'Get the ReportObject by name, convert it to TextObject, and return this object.

GetTextObject = ORPT.ReportDefinition.reportObjects.Item ("text13")

GetTextObject.text = "xxxx system"

Summary: The crystal statement has a very powerful function, and can also perform files such as Word, Excel, RTF, which can also generate complex, beautiful charts, are weapons developed by Web and Windows reports.

(Some of this article from MSDN)

Author: Li Honggen

E-mail: lihonggen0@163.com

Top Reply to: foxtoo (Alibaba and forty stolen) () reputation: 100 2003-6-10 23:07:11 Score: 0 I have the following ideas:

1. Get the SQL database related data by connecting the query; 2, placed in the DataSet;

3, call crystal reports (linear or cylindrical templates), generate reports;

4. Output to generate an Excel document.

Ask you the heroes, how to achieve the above ideas? (If there is an example, it is better)

thank you very much!

-------------------------------------------------- -------------

1. Add a new project DataSet to your project, link the database, the required data sheet or pre-depiction

Drake into this Dataset, compile DataSet

2. Crystal Report comes with VS.NET to establish a report as DataSet

3. Push the data in this report in the program

4. Crystal Report has an option to output an Excel and can be implemented by programs

DIM CONN As SqlConnection

DIM DA As SqldataAdapter

DIM STRSQL AS STRING

CONN = New SqlConnection ()

Conn.connectionstring = "User ID = sa; pwd = 1234; data source = xxxx; initial catalog = xxxxx"

Conn.open ()

strsql = "SELECT * from TableName"

Da = New SqldataAdapter (strsql, conn)

DIM DS AS New DataSet ()

Da.fill (DS, "TableName")

DIM RPTDOC AS New ReportName ()

RPTDoc.SetDataSource (DS)

'Specify data for RPTDOC,

CrystalView1.Reportsource = rptdoc 'Specifies the data to CrystalView

CrystalView1.DATABIND ()

CONN.CLOSE ()

5. If you need to display the field associated with multiple tables, it is best to establish a DataSet in the stored procedure.

-------------------------------------------------- -------------

Please refer to the following code:

String strconn = connection string;

SqlConnection myconn = new sqlConnection (STRCONN);

String strcmd = @ "SELECT statement";

SQLCommand mycmd = new sqlcommand (strcmd, myconn);

Sqldataadapter myda = new sqldataadapter (strcmd, myconn);

DataSet myds = new dataset ();

Myconn.open ();

Myda.Fill (MYDS, "Report Name");

Report name myrpt = new report name ();

Myrpt.SetDataSource (MYDS);

this.crystalReportViewer1.reportsource = Myrpt;

Export to Excel:

Myrpt.ExportOptionS.exportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile;

myrpt.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.Excel; CrystalDecisions.Shared.DiskFileDestinationOptions opt = new CrystalDecisions.Shared.DiskFileDestinationOptions ();

Opt.diskFileName = @ "file name";

Myrpt.ExportOptions.DestinationOptions = OPT;

Myrpt.export ();

Top Reply: Tensun (I want to learn .Net) () Reputation: 100 2003-6-10 23:15:12 Score: 0 Crystal Report 9 Chinese Help Download:

http://www.orrfly.com/download/download.aspx

http://www.enwell.net/soft/

http://www.fast8.com/news.asp

Crystal Reports for Visual Studio .NET

Please refer to PictureObject member

PictureObject class | Crystaldecisions.crystalReports.Engine namespace

Public instance attribute

Border (inherited from ReportObject) Border. Get the Border object.

Height (inherited from ReportObject) INT32. Gets or sets the height of the object with a stone.

Kind (inherited from ReportObject) ReportObjectkind. Get the type of report object.

LEFT (inherited from ReportObject) INT32. Gets or sets the top left corner of the object in the 缇.

Name (inherited from ReportObject) strings. Get the object name.

ObjectFormat (inherited from ReportObject) ObjectFormat. Get the ObjectFormat object.

TOP (inherited from ReportObject) INT32. Gets or sets the top position of the object with the oint.

Width (inherited from ReportObject) INT32. Gets or sets the object width of the 缇.

See

PictureObject class

Imports crystaldecisions.crystalReports.Engine

DIM PicoBject As PictureObject

Picobject = ORPT.ReportDefinition.reportObjects.Item ("Picture1")

Top Reply: Tensun (I want to learn .Net) () Reputation: 100 2003-6-10 23:17:24 Score: 0 From: http://expert.9cbs.net/expert/topic/1896/1896874. XML? Temp = .78677

Everyone uses a crystal statement based on WebForm, if it is simple to follow online "A knife", it will definitely prompt you: landing failed.

For this problem, I spent a whole day to study the help document of the crystal report, and finally get the solution.

I am not a conservative person, I believe there are many netizens who are spending with me in studying this problem. I don't want everyone to spend energy as me as me.

Below is a few steps I implemented. Don't worry, slowly look at you will have a lot of help. Step 1: Look at the sample file

The crystal report comes with an example file, the database is Access (without password). I first run the sample file (webform and winform) results show the correct report, as examples of "flying knives".

So I built a report file and .aspx file, the result shows that the landing failed! But I convert the report file to an example report file, no longer an error.

Where is the problem? Is it a report format file about login privilege? By tracking, debugging, I compare my report files and sample report files without discovering any differences. It seems that the problem is not in the report file.

Is the problem of a database? I created an Access result or landable to fail!

Not a database problem (my own database is unparalleled access, the database in the help)? Nor is the problem of report format file (I carefully analyze the original code of the two)?

So where is the problem? I can't understand!

Step 2: Find a help file

So I once again help. I all over all over the crystal report, I finally found "Access Secure Database [C #]" words, found that there is a paragraph below:

Accessing the secure database through the Crystal Reports for Visual Studio .NET is different between web forms and Windows forms. In the Windows Form, the dialog is automatically prompted to enter the username and password (the test is easy). In a web form, you need to design a form to get this information from the user. For both cases, you can use code to specify usernames and passwords, providing the same security level for all users of the application.

So I am the same database (first use the Access database in the help example, then use the Access database created by yourself). Discovering the same report file, for Winform can show success, and for WebForm still display login failure! So I a little understanding!

It seems that the problem is on the setting of permissions.

Step 3: Research help, finally succeeded!

In the help I found the words "Setting Database Login Parameters", provided some information that later discovered is very useful:

The following example shows how to pass the login parameters into the table of the report. This example uses a connection to a secure SQL Server database.

Start a new project

Add a "button" and four "text box" controls to the form.

Name the "text box" control, respectively: ServerNametXT, DBNametXT, UserNametxt, and Passwordtxt.

Double-click the "Button" control to specify the code of the Click event. Insert the appropriate code according to the language used.

[C #]

// Declare the required variables.

TablelogonInfo LogonInfo = New TablelogonInfo ();

INT i = 0;

// loop in turn on each table in the report.

For (i = 0; i == Report.database.tables.count - 1; i )

{

/ / Set the connection information of the current table.

Logoninfo.connectioninfo.servername = ServerNametxt.Text;

Logoninfo.connectioninfo.databaseName = dbnametxt.text;

Logoninfo.connectioninfo.userid = usernametxt.text; Logoninfo.connectioninfo.Password = passwordtxt.text;

Report.Database.tables [i] .applylogonInfo (LogonInfo);

}

Note that the password-protected Microsoft Access and Paradox and other PC databases also use this method, but logoninfo.servername and Logoninfo.databaseName are left empty.

So I like this, try it, an error message: No TablelogonInfo and Report were found.

Later I found that TablelogonInfo is a member belonging to the CrystalDecisions.Shared namespace. So I added a reference:

USING CRYSTALDECISIONS.SHARED;

This issue appears in Report.

REPORT? What is something, I have all the help, there is no such function or class!

[honestly! This problem is hard to have a long time! I have been looking for Report to something! The water view company is really, help, don't write more than a matter! This is! ! ! ]

Eventually I finally found that the Report is just a user-defined object, not the object of the system itself.

When I was confused, I suddenly thought, why not look at the Database behind the Report, what is something, finally solved, find the following information in the help

ReportDocument ORPT = New ReportDocument ();

Report belongs to the member of the DocumentCrystaldecisions.crystalReports .Engine class.

Modifying code: Adding a reference

Using crystaldecisions.shared; // Responsible for explaining TableLogonInfo class

Using crystaldecisions.crystalreports .Engine; // Responsible for explaining ReportDocument Class Private Void Page_Load (Object Sender, System.EventArgs E)

{

TablelogonInfo LogonInfo = New TablelogonInfo ();

/ / Here, a ReportDocument object REPORT must be applied in advance, and the data report is loaded.

ReportDocument ORPT = New ReportDocument ();

ORPT.LOAD ("c: //inetpub//wwwroot/ //exer/pagelet//crystal//cr1.rpt"); // Modify it to your self //'s correct position

// Establish security information

// Password protected Microsoft Access and Paradox, etc. PC databases, but logoninfo.servername // and logoninfo.databaseename want to keep empty

LogonInfo.connectioninfo.servername = "www";

Logoninfo.connectioninfo.databaseName = "Archives";

Logoninfo.connectioninfo.userid = "sa";

LogonInfo.connectioninfo.password = "123456";

ORPT.Database .Tables [0] .applylogonInfo (LogonInfo); // Establish a connection between .RPT files and CrystalReportViewer files

CrystalReportViewer1.Reportsource = ORPT;

}

Report files have finally appeared!

Wow, I am so happy, I can't stop standing up and stretched a lazy waist!

Step 4: The final full version of the code

The above code does not have system expansion and flexibility. There are two shortcomings:

(1), the data report format file is an absolute path

(2) Once the setting of database access is set, it is unmodable in the final release, especially the customer's SQL Server server is not like the program environment you debug.

Based on this consideration. Introducing two more good things:

(1), Server.mappath function

(2) Read web.config (this example also tells you how to operate the web.config configuration file)

The final revision is as follows: (full code) database is SQL Server2000

Using crystaldecisions.shared; // Responsible for explaining TableLogonInfo class

Using crystaldecisions.crystalreports .Engine; // Responsible to explain the ReportDocument class

Private Void Page_Load (Object Sender, System.EventArgs E)

{

TablelogonInfo LogonInfo = New TablelogonInfo ();

/ / Here, a ReportDocument object REPORT must be applied in advance, and the data report is loaded.

ReportDocument ORPT = New ReportDocument ();

// Get the true path of the.rpt file

String path1, path2;

Path1 = Server.mappath ("// EXER // Pagelet");

Path2 = Path1 "// Crystal // Cr1.rpt";

//orpt.load ("c://inetpub//wwwroot//exer/pagelet//crystal//cr1.rpt ");

ORPT.LOAD (PATH2);

/ / Get the logonInfo parameter information from Web.config

String A, B, C, D;

// Get servername

A = system.configuration .configurationSettings .appsettings ["servername"];

/ / Get DatabaseName

B = system.configuration .configurationSettings .Appsettings ["Database"];

// Get userid

C = system.configuration .configurationSettings .Appsettings ["userid"];

/ / Get password

D = system.configuration .configurationSettings .Appsettings ["pass"];

// Set the logonInfo parameter

Logonifo.connectioninfo.servername = a;

LogonInfo.connectioninfo.databaseName = B;

Logoninfo.connectioninfo.userid = C; logoninfo.connectioninfo.password = D;

ORPT.DATABASE .TABLES [0] .applylogoninfo (logonfo);

// Establish a connection between the.rpt file and the CrystalReportViewer file.

CrystalReportViewer1.Reportsource = ORPT;

}

Operation procedure for the entire presentation:

1. In the Solution Explorer, you need to store the report file, add new items: CrystalReport report, named CR1.RPT

2. When selecting a data source in the Subsequent Report Experts, be sure to select OLE DB, then select the drive engine that responds according to your database:

SQL Server: Microsoft Ole DB Provider for SQL Server

Access: Microsoft Jet.4.0

3, enter the correct database connection, this step will not be wrong without anything!

4, establish a data report, and save the CR1.RPT file

5. Open WebForm1.aspx. Add CrystalReportViewer Control: Name: CrystalReportViewer1

6, add the above code in the Page_Load event in WebForm1.aspx.cs:

(Note: Don't forget to quote!)

*********************************************************** ***

Here is the details related to this content in web.config

*** Note that is Pass, so he must

/ / Get password

D = system.configuration .configurationSettings .Appsettings ["pass"]; here

"PASS" in AppsetTings ["pass"] is consistent. Of course, the name can be casual, but must be consistent

*********************************************************** ******************

Transfer from www.chinaspx.com

Author: ydmwy

Top Reply: Tensun (I want to learn .Net) () Reputation: 100 2003-6-10 23:20:20 Score: 0 The above post solves the database with password, crystal report tips: login failure! ! (If the database has no password, there is no problem !!)

Top Reply to: efyrose (Walking Fish) () Reputation: 100 2003-6-11 9:21:37 Score: 0 You are all good, touched ing. Top Reply to: Chyich () () Reputation: 100 2003-6-11 9:50:54 Score: 0 Up

Top Reply to: wen98091 (天蓝 瓜子) () Reputation: 100 2003-6-11 9:52:22 Score: 0 THX

Top Reply to: XHDAI1 (Pioneer) () Reputation: 100 2003-6-11 11:02:05 Score: 0 Chinese Help of Crystal Report 9

http://www.orrfly.com/download/download.aspx

How can I enter the login when downloading? What is the password of the username?

Top Reply to: efyrose (Walking Fish) () Reputation: 100 2003-6-11 11:03:32 Score: 0 Ask, why I added a DataSet, drag into a table in the database, then point to generate, When adding a blank statement, add a database to the report, pop-up the database expert, select the ADO.NET dataset in the project data. Licening my Dataset1, however, click on DataSet1 to expand him, next level prompt ".. no items found." Cannot be added to the report in the report, hoped with Multi-advice

Top Reply to: Fengxin107 (chasing rainbow) () Reputation: 100 2003-6-11 11:10:14 Score: 0 See ing ...

Top Replyee: liuketao111 () reputation: 64 2003-6-11 11:38:16 Score: 0 Ask a few masters on the building, I have recently installed CrystalReport, the following error, I don't know how to deal with, please help !

Description: An error occurred during the process of compiling to the request to provide the resource required. Please check the following specific error details and modify the source code appropriately.

Compiler error message: CS1595: "CrystalDecisions.Web.crystalReportViewer" is already defined in multiple places; use "c: /winnt/assembily/gac/crystaldecisions.web/9.1.300.0__692fbea5521e1304/crystaldecisions.web.dll" definition

Source error:

Row 14:

Line 15:

Line 16:

Top Replyess: JORCKS2002 (JORCKS2002) () Reputation: 90 2003-6-11 14:57:11 Score: 0 I also encountered the same problem installed Cry9.2 Chinese version, CrystalReportViewer9.2 in PUSH mode Can't use, blame!

Top Reply: KLD3000 (Wang Yang) () Reputation: 100 2003-6-11 15:19:28 Score: 0 Collection

Top Reply to: YTWXW (WXW) () Reputation: 99 2003-6-11 15:32:08 Score: 0 I would like to solve the problem of printing

Do you need to export again?

Top Reply to: GreyStar (GreyStar) () Reputation: 100 2003-6-11 15:55:23 Score: 0 Thanks

Top Reply to: FoxToo (Alibaba and forty stolen) () Reputation: 100 2003-6-11 16:57:39 Score: 0 efyrose (Walking fish):

Ask, why I add a DataSet, drag into a table in the database, then generate, add a blank report to add a database to the report, pop-up database experts, select the ADO.NET dataset in the project data. Licening my DataSet1, however, click on DataSet1 to expand him, next level prompt ".. Did not find the project .." If you can't add a table in the report, you will be the most likely reason why the expertise is: Add After the data set object, after the data set object is updated, there is no from the new project,

Method: Select menu - "Regeneration ***" in the generation.

If there is no current project, you can click "ADO.NET (XML)" from "More Data Source" to add a data set outside the project.

Top Reply to: FoxToo (Alibaba and forty stolen) () reputation: 100 2003-6-11 17:01:21 Score: 0 For Cyr9.0 issues, because I have been using the CYR comes with VS, So you can't answer your questions. . .

I hope to have a colleagren with CYR9 and tell the experience. . . . . .

Top Reply to: FoxToo (Alibaba and forty stolen) () Reputation: 100 2003-6-11 17:13:25 Score: 0 About CRY printing:

CRY is divided by WINDOWFORM and WebForm. It is different. He always lesically: CRY is more than the functionality provided in WindowForm than in WebForm, including printing.

Using CRY in the Web, it does not provide printing capabilities, so you can only use print functions in IE (huh, do not include self-on print controls).

Top Reply: AMENG_2002 (Flyfox) () Reputation: 105 2003-6-11 19:12:42 Score: 0 good comrades

Top Reply to: JJSTAR (Northern) () Reputation: 96 2003-6-11 20:27:55 Score: 0 hit a standard

Top Reply: Tensun (I want to learn .Net) () Reputation: 100 2003-6-11 23:49:06 Score: 0 I want to ask a question:

About using ADO. NET data set generation chart, I hope to generate a chart, that is, how to generate a chart according to my selection field (pie chart or histogram), what should I do? ? It seems that if you want to generate a picture, you must first specify a field to be statistically in the RPT file, so you can't be dynamically realized. . . . . Very urgent, can someone help me? ? ?

Top Reply to: efyrose (Walking Fish) () Reputation: 100 2003-6-12 8:28:21 Score: 0 Anna_Aiya (Oops) FoxToo (Alibaba and forty stolen) Thank you,. I also built a Dataset yesterday. And that DataSet1 I deleted rebuilt and returned and regenerated. Just now, I tried it again. This time passed. Quilable

Top Replyee: JORCKS2002 (JORCKS2002) () Reputation: 90 2003-6-12 9:22:58 Score: 0 to; Tensun (I want to learn .NET)

You can use dataset.xsd, data is dynamic, the generated table is dynamic.

Top Reply: zhangbat (jim) () Reputation: 100 2003-6-12 9:37:08 Score: Migrants on the 0 floor: How to dynamically designate the statistical pattern of crystal reports when the program is running?

For example, from the column map to the line map?

Top Reply to: Rainlow (Rainbow) () Reputation: 81 2003-6-12 12:24:03 Score: 0 TextObject IText, NText;

/ / After obtaining ReportObject, convert it to TextObject and return this object.

Itext = rptint.reportdefinition.reportObjects ["text12"] as textobject;

Ntext = rptint.reportdefinition.reportObjects ["text11] as textobject;

IF (IText! = null) {IText.Text = DR ["Rate"]. TOSTRING ();

IF (nText! = null) {ntext.text = DR ["DRATE"]. Tostring ();

This is the code, why does the text object in the report do not display the value? I am debugging, some.

Top Reply to: new_bug (water) () Reputation: 100 2003-6-12 12:33:50 Score: 0 Support ING

Top Reply to: www9cbscom (www9cbscom) () Reputation: 100 2003-6-12 15:02:37 Score: 0 Which master provides a CYR9.0 download address

Top Reply to: FoxToo (Alibaba and forty stolen) () Reputation: 100 2003-6-12 21:03:36 Score: 0 ADO Record Set and Crystal Report 40STAR (original)

Keyword Crystal Report ADO TTX

When using a crystal report, it is often not very good to control, and finally use this ultimate trick. That is to use the data definition file (TTX) to transmit the obtained ADO recordset to the crystal report.

Typically, the crystal report is created from the physical database, but now there is 32-bit Active Data Driver - P2Smon.dll, crystal can be connected to a database in advance.

First, you need to create a TTX file, after entering the data source, after selecting the form,

Click the " " after " " to pop the data source form

At this point, we use the "New" button to create a new data definition file (TTX), the format is as follows

After saving, we open this text file, you will find the format of the TTX file, which is the TAB segmentation.

Then, we follow the old set of streets of the crystal report, the rest is to pass the recorder.

Below, we must declare the API that the ADO record set needs.

Public Declare Function Peopenengine LIB "crpe32.dll" () AS INTEGER

Public Declare Function PegeterRorcode Lib "crpe32.dll" AS Integer

Public Declare Function PeopenPrintJob "crpe32.dll" (Byval Rptname As String) AS IntegerPublic Declare Function Peutputtowindow Lib "crpe32.dll" (_

Byval PrintJob as integer, _

Byval Title As String, _

Byval Left as long, _

Byval Top as long, _

Byval width as long, _

Byval Height As long, _

Byval style as long, _

BYVAL PWINDOW AS Long AS Integer

Public Declare Function peutputtoprinter lib "crpe32.dll" (_

Byval PrintJob as integer, _

Byval NCOPIES AS INTEGER AS INTEGER

Public Declare Function PestartPrintJob LIB "crpe32.dll" (_

Byval PrintJob as integer, _

BYVAL WAITORNOT AS INTEGER AS INTEGER

Public Declare Function PeclosePrintJob Lib "crpe32.dll" (Byval PrintJob As Integer) AS INTEGER

Public Declare Sub PecloseEngine LIB "crpe32.dll" ()

Public Declare Function CreatefieldDeffile LIB "P2Smon.dll" (_

LPunk As Object, ByVal_

Filename as string, _

BYVAL BOVERWRITEEXISTINGFILE AS Long AS Long

Public Declare Function Vbencodelptr Lib "P2SMon.dll" (x as object) AS STRING

Public Declare Function SetActiveDataSource LIB "P2SMon.dll" (_

Byval PrintJob as integer, _

Byval Tablenum as integer, _

X as long

Finally, give the printed code of the report.

DIM JOB AS INTEGER

DIM HANDLE AS INTEGER

'Open the print engine

Handle = peponengine

'Crystal error handling

IF Handle = 0 THEN

ErrorNum = PegeterRrorcode (Handle)

Msgbox "Print Engine Error!"

MsgBox "Error Code:" & ErrorNum

END IF

'Open print job

Job = peopenprintjob (app.path & "/new.rpt")

'Crystal error handling

IF job = 0 THEN

ErrorNum = PegeterRrorcode (Job)

Msgbox "Open the job new.rpt failed!"

MsgBox "Error Code:" & ErrorNum

END IF

'Send the ADO record set to the crystal report, the generation of Adorecordset no longer says Handle = SetActiveDataSource (Job, 0, Adors)

'Output to print preview window

Handle = peutputtowindow (job, "new.rpt", 0, 0, 520, 520, ws_maximize, 0)

'Direct output to the printer

Handle = peutputtoprinter (job, 1)

'Crystal error handling

IF Handle <> 0 THEN

Handle = pestartprintjob (job, true)

IF Handle <> 0 THEN

Msgbox "printing"

Else

ErrorNum = PegeterRrorcode (Job)

Msgbox "print failed!"

MsgBox "Error Code:" & ErrorNum

END IF

Else

ErrorNum = PegeterRrorcode (Job)

Msgbox "Unable to output to form or printer"

MsgBox "Error Code:" & ErrorNum

END IF

'Close the print job

PECLOSEPRINTJOB (JOB)

'Close the print engine

PECLOSEENGINE

I am using VB6 crystal report 8.5, I feel that this way is more flexible and solves the problem of crystal report replenishment.

Top Reply to: FoxToo (Alibaba and forty stolen) () Reputation: 100 2003-6-12 21:09:53 Score: 0 About how to implement printing:

Private void Button1_Click (Object Sender, System.Eventargs E)

{

String printername;

Printername = this.TextBox1 .text .trim ();

//orpt.printOptions .printername = "HP LaserJet 6L";

ORPT.PRINTOPTION.PRINTERNAME = Printername

ORPT.PRINTTOPRINTER (1, False, 1, 1);

}

Here's ORPT Please see my post on login mistakes (this is a global variable)

Problems on how to implement print preview:

Private void buttonpreview_click (Object Sender, System.Eventargs E)

{

CrystalReportViewer1.Reportsource = ORPT;

}

About CrystalReportViewer1, orpt, please see my post on login wrong post (this is a global variable)

Questions about printing can only be executed on the server

? Program principle:

The customer performs the print command on the "Print" button on my Print.aspx page in the browser terminal. Customers can enter their own printer names in the text box of the customer's local printer, and the print task should be executed on the client's printer.

It can actually be implemented in accordance with the requirements described above.

If the client's printer name (eg, HP5000) and the name of the printer set in the .rpt report format file, the system will be wrong, the system will be wrong, prompting the printer can not be found. When printing, I will let the user according to my own computer.

If the client's printer name (for example, HP5000) and the name of the printer set in the .rpt report format file, the customer performs print tasks on the client. However, on the server-side printer, the print task is successfully executed, but the client's printer is not reflected (according to the execution should be executed on the client's printer). Taken from: http://www.aspx.cn/club/forum.asp? Forum_id = 3

Top Reply to: FoxToo (Alibaba and forty stolen) () reputation: 100 2003-6-12 21:20:03 Score: 0 Crystal Report:

http://www.aspxcn.com/dotnetbbs/good.aspx?fbid=23

Top Reply to: derek () () Reputation: 99 2003-6-13 8:59:56 Score: 0 Collection

Top Reply: liuyong_lt (孤 孤) () Reputation: 99 2003-6-13 14:05:52 Score: 0 Collection

Top Reply to: FoxToo (Alibaba and forty stolen) () Reputation: 100 2003-6-13 22:45:15 Score: 0 Crystal Reports 9 .NET Installation

• Crystal Reports 9 integrates its feature into the Visual Studio .NET integration development environment (IDE) to enhance the development efficiency of Visual Studio .NET (VS .NET). Therefore, you must install all .NET products before installing Crystal Reports 9, otherwise, you must re-run the Crystal Reports 9 or Report Application Server 9 (RAS) installer after each .NET product installed. (Adapt 87307)

Below is an example installation order:

1. If you want to make your development machine to host a web application, make sure you install Internet Information Server (IIS) 5 or higher. If you are installed on Windows NT 4, you will not be able to create a web application on your machine's IIS Web server; when you create a web application in Visual Studio .NET, you need to point to Win2000 or Windows .NET Server. For more information, see the Visual Studio .NET documentation.

2. Install Visual Studio .NET 2002.

3. Install the .NET mobile control SDK.

4. Install Crystal Reports 9.

5. Install Report Application Server 9.

We have greatly recommended that you install at least the Report Application Server 9 software development kit (Ras 9 SDK) from the RAS 9 installer after installing Crystal Reports 9, because some VS .NET 2002 features depend on RAS 9 SDK. Most Demonstration Crystal Reports 9 and Ras 9 new features are provided in the example of RAS 9.

• After uninstalling the Crystal Reports 9 from Visual Studio .NET, the Crystal Reports component of .NET may work abnormal. To recover the feature, you should run the repair function in the .NET installer. (Adapt 89415)

• If you install the Crystal Reports 9 and select the "Crystal Reports for Visual Studio .NET" option to re-run the installation of Visual Studio .NET 2002 (VS .NET 2002), you will encounter some problems. In the toolbox, the Crystal Reports 9 and VS .NET 2002 controls will be included, but VS .NET 2002 generates the control code, as a web service release, etc. To re-get the Crystal Reports 9, you need to re-run the CR9 installation in the repair mode. To correctly degrading VS .NET 2002 without Crystal Reports 9, uninstall CR9 and re-run the VS .NET 2002 in the repair mode. (Adapt 90314) • When a .NET Framework or Visual Studio .NET is not detected, the relevant installation function will be disabled to avoid accidental. If necessary, you can define public property ShowAllFeatures = 1 when starting setup.exe (Adapt 59029).

• The server file node under "Crystal Services" in Server Explorer is no longer communicating with the Web service of ServerFileReportManager.asmx. Instead, it contacts the local connection manager of the Report Application Server on the specified machine. To work on the server file node, you must run querysrv.exe on the specified machine.

Similarly, the "Crystal Enterprise" node in Server Explorer is no longer communicating with EnterprisePortManager.asmx. Now it communicates with the Crystal Enterprise APS via Enterprise Bus Ebus-3-3-2.dll. (Adapt 87302)

For more information, see Knowledge Base Articles:

Http://support.crystaldecisions.com/kbase/c2010319.asp.

• If you have used the ServerFileReportService.asmx Web service provided with Visual Studio .NET 2002, you can continue to use this service, but it cannot be used in new features such as report parts navigation. Although the Crystal Reports 9 Windows Forms and Web Forms CrystalReportViewer controls may be able to work with old Visual Studio .NET 2002 ServerFileReportService.asmx, this configuration is not supported. However, Crystal Reports 9 ServerFileReportService.asmx is designed to be used in a client application created by the old CrystalReportViewer controls in Visual Studio .NET 2002.

To upgrade the web server to use the new Crystal Reports 9 ServerFileReportService.asmx, use the Internet Information Services configuration tool to map the virtual directory "/ CRYSTALREPORTWEBFORMVIEWER" to:

"C: / Program Files / Common Files / Crystal Decisions / 2.0 / CrystalReportViewers"

(Or the corresponding directory in the product installation).

In Crystal Reports 9, ServerFileReportManager.asmx and ServerFileReportService.asmx Web services are still installed by default to the "C: / Program Files / Microsoft Visual Studio .NET / CRYSTAL Reports / Samples / Reports" directory. To change, modify file web.config in C: / Program Files / Common Files / Crystal Decisions / 2.0 / CrystalReportViewers, add and XML nodes. Below is an example of a web.config file, where the server file directory tree is c: / inetpub / wwwroot:

TYPE = "System.configuration.nameValuesectionHandler, System, Version = 1.0.3300.0, Culture = Neutral,

PublickeyToken = B77A5C561934E089, Custom = NULL "/>

Set the debugmode enable to "True" Enable ASPX debugging. However, the value is set to "false" will increase the runtime performance of the application.

->

PublickeyToken = 692FBEA5521E1304 "/>

Application Level Tracking Features Generate Track Log Outputs for each page in the application.

Set the Trace Enabled to "True" to enable application tracking logging. If Pageoutput is set to "True",

The tracking information is displayed on the bottom of each page. If not displayed, you can browse the "TRACE.AXD" page from the web application root to view the application tracking log.

->

(Adapt 87302)

Top Reply to: FoxToo (Alibaba and forty stolen) () Reputation: 100 2003-6-13 22:45:37 Score: 0 • After the Crystal Reports 9 is installed, if you customize the toolbox and enter the .NET framework Components may encounter the following error:

"The following assembly is an installed SDK assembly, but it is not displayed in the Custom Toolbox dialog as it lacks one or more components. Make sure all necessary libraries can be used .crystaldecisions.Web.Mobile.dll "

This error occurs only when the mobile component is not installed. (Adapt 81046)

• Some Crystal Reports .NET features the feature of Report Application Server (RAS) SDK. For example, if you are changing to another report object in the .NET WebForms viewer, and you specify a "RAS: //" path in the Report URI field, the .NET WebForms viewer will depend on Ras SDK. If RAS SDK is not installed, the following error message will appear:

Enterprise Report Application Server is not found. Make sure you have specified an EnterprisingSession.

To install RAS SDK, run the Report Application Server 9 installer, select Custom Install and select "Report Application SDK". If the RAS server installation and run is not done in the same machine, you need to point your default ReportAppServer to another machine; for details, see "Report Application Server (RAS) installation".

• When you start the VS .NET IDE, "Package Load Failed" will appear when loading the VSRPTDesigner package or the "Crystal Reports Tool" package in VS .NET. To resolve this error, you must run VS.NET with an account or a non-roaming profile of an administrator privilege. This problem is caused by the vs.net IDE from :: cryptacquirecontext () to get a encryption service provider when providing a program.

• In a Windows operating system, the currency, date, and numbers in the .rpt file are formatted by the area you want. To resolve this issue, there are two options:

- Run IIS in the localized operating system (OS). For example, in a Japanese operating system, the user's default zone of the System account is set to 1041 = Japanese, so the date and currency of Japanese can be displayed correctly. - Create a "UserJapanese" account in the "User" and "Administrator" group, and set "IIS Management Service", "FTP Publish Service", "Simple Mail Transfer Protocol Service" and "World Wide Web Publish Service" to "UserJapanese" runs. This account must be in the "Administrator" group and you need to use the Local Security Policy applet to add additional user rights:

• As part of the operating system

• Generate a security audit

• Log in as a service

• Replace Process Level Tag

This problem occurs because ASPNET_ISAPI.DLL calls CREATEPROCESSSUSER () to create an ASPNET_WP.EXE auxiliary process for this .NET code. However, CreateProcessAsUser () enables the HKEY_CURRENT_USER registry configuration unit in ASPNET_WP.EXE to point to the INetInfo.exe user (1033 (English) System account in English operating system) configuration unit.

• CRDB_ADOPLUS.DLL cannot be installed on request. The following error message appears: "Load Database Information Failure".

This problem occurs when you install CRYSTAL Reports when you install ADO.NET on request. In these cases, crdb_adoplus.dll can only be installed on demand (that is, when the data data data of the data resource manager is expanded). If you want to load and run an application using crdb_adoplus.dll (an ADO .NET Dataset Application) application, the application will not find the Dynamic Link Library (DLL).

You can use one of the following two methods to solve this problem:

- Enter the data resource manager and expand the project data. This will install the DLL on demand.

- Enter Crystal Reports settings and enter the addition / delete to expand Data Access. Select to install ADO.NET to your hard drive.

• The Crystal Reports 9 documentation contains a chapter that describes the runtime when deploying the Crystal Reports .NET. The merge modules listed below are the required files: Managed.MSM, Database_Access.ms.msm, Database_Access_enu.msm and RegWiz.msm. You may find files that have already named these file names on your machine, but these files are probably installed by the previous version of Crystal Reports .NET SDK provided with Visual Studio .NET. To get these files corresponding to the file versions of Crystal Reports 9, visit the Crystal Care Technical Support Web site: http://support.crystaldecisions.com/updates/. After entering the Web site, select "Crystal Reports" in "Select A Product", select "9" in "SELECT A Product Version" (select a product version), "SELECT A File Type" (Select a file type) Select "Product Update" and click the "Go" to search the merge module.

Top Reply to: FoxToo (Alibaba and forty stolen) () Reputation: 100 2003-6-13 22:52:15 Score: 0 Our support website: http://support.crystaldecisions.com. For more information, please visit our website:

Crystal Reports Product News

Http://china.crystaldecisions.com/products/crystalreports/

Crystal Reports Demo

http://www.crystaldecisions.com/products/crystalreports/showme/

Crystal Enterprise Product News

Http://china.crystaldecisions.com/products/crystalenterprise/

product information

Http://china.crystaldecisions.com/products/

Developer community

Http://www.crystaldecisions.com/products/dev_zone/

Online support, examples and technical briefings

http://support.crystaldecisions.com

Training and consultation

Http://china.crystaldecisions.com/services/

Crystal Decisions Home

Http://china.crystaldecisions.com

Top Replyee: sunqcn () () Reputation: 98 2003-6-14 13:36:55 Score: 0 China must be strong, because China has a lot of people like the Lord.

Top Reply to: Youngby (Poet & Sql & Net) () Reputation: 100 2003-6-14 13:41:06 Score: 0 Up

Top Reply: FoxToo (Alibaba and forty stolen) () reputation: 100 2003-6-14 22:24:13 Score: 0 Everyone has any good experience, experience, example, you can post, because about about Cry example, less articles, and more problems in this area, I hope everyone can post successful experience, which makes many people to walk less. . . . . Thank you. . . ! ! !

Top Reply to: waterf () () Reputation: 22 2003-6-16 16:38:50 Score: 0 Up

TOP replose: Amaomaoa () () Reputation: 100 2003-6-16 20:12:54 Score: 0 .NET Crystal Report Data Access Strategy

The first method, the Crystal Report engine extracts data from the data source associated with it. Crystal Report can use the industry standard OLE DB or ODBC to join the database, which can also query the Excel workbook or Access database using other special drives (included in the package). Developers can start built-in tenders, select the data source used to extract data, then select the tables and fields in the report. Since the above process is completed in the program design, users do not need to obtain data for the report for the report when running.

The "push" method is another way to report access data. In this approach, the developer establishes a form and field in the report design phase. Developers create a data set that exists while the program is running and is passed to the report; this is in the first method to secure the code fixed data source. If the specified type (Typed) dataset is used in the .NET project, the developer can use this dataset as a model definition in the report to the report. At runtime, developers only need to fill the data set and pass the filled data column to the report through the setDataSource method. There are two types that can access the SETDATASOURCE method. The ReportDocument class is the package of the report itself; it accesses SetDataSource as a method. If your dataset contains all the forms and they match the definitions in the report, you should call SetDataSource by report objects. The database properties are also accessed through the report object, which has a table collection. The Table class also has a SetDataSource method. You can call SetDataSource by retrieving the appropriate form, and pass the appropriate record of the appropriate record in the data set directly to the report table.

The choice of these two methods is not mutually exclusive, and developers can mix them in the same report so that the Crystal Report engine is possible to extract data from different data sources at the program runtime. However, considering the limitations of these two methods, you must decide to use one or all of them.

Top Reply to: Carrel (End) () Reputation: 100 2003-6-17 13:47:07 Score: 0 Up

Top Reply to: Letian (you are happy, so I am happy) () Reputation: 105 2003-6-17 17:43:00 Score: 0 Ask you all the issues related to the printed report, THX

Implement printing with the following code, why prompt: invalid report file path

String printername;

ORPT.PRINTOPTIONS.PRINTERNAME = "HP LaserJet 6L";

ORPT.PRINTTOPRINTER (1, False, 1, 1);

Top Reply to: Tensun (I want to learn .Net) () Reputation: 100 2003-6-17 22:50:52 Score: 0 Up

Top Reply to: flying_sunny (handsome) () Reputation: 98 2003-6-19 14:06:38 Score: 0 I recently used the crystal statement to encounter a problem, please teach colleagues, I don't know what happened.

Is such that

Top Reply to: flying_sunny (handsome) () Reputation: 98 2003-6-19 14:10:40 Score: 0 is the sample, bind a report in WebForm1

Write like a code in Page_Load

CrystalReportViewer1.reportsource = ".. Application Location / Report Name"

CrystalReportViewer1.DATABIND ()

Compilation Run:

Server errors in the "/ Testhuang" application.

-------------------------------------------------- ------------------------------

Examples of the object are not set to the object.

Description: Execute an unprocessed exception during the current web request. Check the stack tracking information to learn more about the error and the code caused in the code.

Abnormal Details: System.NullReferenceException: The object is not set to an instance of an object.

Source error:

Unprocessed exceptions were generated during the current web request. You can use the following exception stack tracking information to determine information about exception causes and location. Stack tracking:

[NullReferenceException: The object is not set to an instance of an object. ]

CrystalDecisions.web..get_7 ()

Crystaldecisions.Web.crystalReportViewer.onInit (Eventargs E)

System.Web.ui.Control.initRecursive (Control NamingContainer)

System.Web.ui.Control.initRecursive (Control NamingContainer)

System.Web.ui.Control.initRecursive (Control NamingContainer)

System.Web.ui.page.ProcessRequestMain ()

I have tried a lot of ways, I can't find the problem, the master helps to see it, thank you, thank you!

Top Reply: YUETONG (Requires Communication) () Reputation: 100 2003-6-20 8:20:36 Score: 0 flying_sunny: Should be your location is not written! Please check the path carefully and / change to //

Top Reply: YUETONG (Requires Exchange) () Reputation: 100 2003-6-20 8:20:49 Score: 0 flying_sunny: Should be your location is not written! Please check the path carefully and / change to //

Top Replyee: yanghai0437 (Wanderer) () Reputation: 99 2003-6-20 15:47:30 Score: 0 Group Style Design (with Crystal Report)

E.g:

Team | Work Over | Qualified Number |

----- | ------- | -------- | -------

| SHU59 | 102273 | 98.85%

| -------------------------

Group A | SHU79 | 97977 | 98.77%

| ------------------------

| SHU43 | 234234 | 96.30%

----- | ------- | -------- | --------

A combination meter | 2342344 | 98.44%

------------- | -------- | --------

| SHU67 | 102273 | 98.85%

| -------------------------

Group B | SHU45 | 97977 | 98.77%

| ------------------------

| SHU42 | 234234 | 96.30%

----- | ------- | -------- | --------

B combination | 2323444 | 92.44%

_____________ | ________ | ________

Two-Combination | 362344 | 94.44%

______________________________

Top Reply: Wenejiang (龙) () Reputation: 99 2003-6-20 16:03:36 Score: 0 I think it should open a special title, otherwise it is too long here.

I also have a lot of questions to ask, for example, how did the crystal report have been used to customers? Is the crystal report in vs.net!

Top Reply to: FoxToo (Alibaba and forty stolen) () reputation: 100 2003-6-20 22:00:48 Score: 0 to: yanghai0437 (Wanderer) Pieces of assembly, direct use of report experts can be realized, detail Steps should look at the front.

TO: ALL

Through these days, the crystal reports are increasingly feeling, and the flexibility of its functionality, and combination is precisely because of this, only the complexity of use: Different operation steps, different environments, different conditions, different The combination. . . . It is possible to cause failure of runtime. . . .

Therefore, it is recommended that everyone will not be discouraged after an error, to make more debugging, carefully find out the wrong reason, this is the purpose of my opening, every error you find, every abnormality that runs, it is possible In the machine's machine, I hope to tell it. . . .

I believe that each colleagues who have made crystal reports have encountered such problems, and when we solve these problems, we have to play a strong function of crystal reports.

Top Reply to: CER (Training Building) () Reputation: 98 2003-6-21 8:48:26 Score: 0 Very good State Collection

Top Reply: xiaoyq (xiaoyq) () Reputation: 88 2003-6-21 10:58:07 Score: 0 I use a crystal report in several systems, but I have not solved the print problem (in WebForm).

Does anyone have a good solution?

Top Reply to: YYLALY (YYL) () Reputation: 100 2003-6-23 8:58:13 Score: 0 Up!

thank!

really thankful!

thank you very much!

Top Reply to: Hzsummer (selling girl's small matches) () reputation: 100 2003-6-23 9:46:39 Score: 0 very good!

Good people, good text!

Top Reply to: Benben1hao (Benben No.1) () Reputation: 77 2003-6-23 19:31:48 Score: 0 Collection

TOP

转载请注明原文地址:https://www.9cbs.com/read-66006.html

New Post(0)