Crystal report

xiaoxiao2021-03-06  102

1. Crystal report is there. Package in NET

Principle: With Microsoft Installer (MSI) distributed in the merge module (MSM) included in your installation package. The MSI Merge Module (MSM) can be found in the "C: / Program Files / Common Files / Merge Modules" directory. The merge module (MSM) is divided into three categories: managed components, database access, and key numbers. Managed Components MSM processes the distribution of all managed components, including Windows Forms Viewers, Web Forms Viewers, and all Crystal Decisions namespaces. For all other files required to run the report, access the MSM from the database to distribute it. These include databases, export, and chart drivers. The Keycode MSM handles the installation of the Crystal Decisions key number so that your user will not be required to register their Crystal version when viewing the report.

Specific steps: 1) New "Installation and Deployment Project" -> "Installation Wizard" 2) Select Project Type (Select "Create a Setup for Windows Applications") -> Next 3) Select to include File: Add your program file C: / Program Files / Common Files / Merge Modules undermanaged.msm, database_access.msm, database_access_chs.msm, database_access_chs.msm, regwiz.msm, vc_crt.msm, vc_stl.msm. -> Completed

The specific functions are as follows: Managed.msm, Managed_chs.msm, (Managed Components MSM processes all managed components distribution, including Windows Form Viewer, Web Form Viewer, and All Crystal Decisions Namespaces) Database_Access.msm, Database_access_chs.msm (For all other files needed to make the report, access the MSM is distributed by the database. These include databases, export, and chart drivers.) RegWIZ.MSM, (KeyCode MSM) VC_CRT. MSM, VC_STL.MSM (this absolutely not mentioned on the MSDN, is a VC runtime, estimate is written by Crystal Report or some programs involved in VC, so you need it!)

Select the file you want to include: Add your program file C: / Program Files / Common Files / Merge Modules under Managed.msm, Database_access_chs.msm, database_access_chs.msm, regWiz.msm, Vc_CRT.MSM, VC_STL . msm. -> Complete the addition of this is in the Solution Explorer, install the project, play right, select "Merge Module" to add.

4) Open the solution -> Right click on the properties of the Regwiz MSM, "License Key" in "MergeMouduleProperties" Fill in: AAP5GKS0000GDE100DS (this is the password you generated by the Crystal Report is the password of the registration number!)

5) Generate a solution (or press CTRL SHIFT B)

It has been solved! It turns out the following method to see many people in this problem, attached to the following:

---------------------------------- Solution 1: Report Data Access Use Push Model Need to write code Connect to the database, execute the SQL command to create a recordset or dataset matching the fields in the report, and pass the object to the report. This method allows you to share the connection into the application and filter data before Crystal Reports receives data. ---------------------------------- Solution 2: Record the custom formula to run custom

1, transmission control selection by the viewer formula [Visual Basic] Dim SelectFormula As StringSelectFormula = & textBox1 () TextcrystalReportViewer1.SelectionFormula = SelectFormula [C #] string selectFormula "> {last customer sales.}";. SelectFormula = "{Customer year's sales}> " textBox1.Text; crystalReportViewer1.SelectionFormula = selectFormula; [C ] String * selectFormula; selectFormula-> Concat (". {last customer sales}> ", textBox1-> Text); crystalReportViewer1-> Selectionformula = SELECTFORMULA;

2, passing through a selected report object formula [Visual Basic] Dim selectFormula As StringselectFormula = & textBox1 () TextReport.DataDefinition.RecordSelectionFormula = selectFormula [C #] string selectFormula "> {last customer sales.}";. SelectFormula = "{ Customer. Last year sales}> " textBox1.text; report.datefinition.recordselectionformula = selectformula; [c ] string * selectformula; selectformula-> concat (" {Customer. Last year Sales}> ", TextBox1-> text); Report-> DATADEFINITION-> RecordSelectionformula = SELECTFORMULA; 3, refresh the corresponding report, the method is to end this code using the following code line: CrystalReportViewer1.Refreshreport () This formula is updated, will use the new minimum (previous year sales) ). ---------------------------------- Solution 3: Merge parameters to record selected formula

The parameter field does not have to be placed in the report to be used in the record or group selection formula. Create a parameter field and enter it into the formula as inserted into other fields.

Use the formula to record the output to reduce the amount of data transmitted from the database server and improve performance, simultaneously merge the parameter field to record the selected formula. The following record selection formula is drew user input sales quota and only the last year's sales exceeds the sales quota. {Customer. Last year sales}> {? Salesquota}

Need to write code to transfer the parameter value at runtime ...

2. Digital transformation into currency Chinese characters

Function GetChinanum (ORGNUM As Double, Optional Dotnum as "AS String 'Parameters ORGNUM: is a number' parameter ismoney: Is it returned to RMB? (1 Return) 'parameter dotnum: To set the number of bits behind the decimal point The default is 0, a maximum of 8 Dim OrgNum as Double OrgNum = 123.45 Dim IsMoney as Integer IsMoney = 1 Dim dotNum as Integer dotNum = 2 Dim GetChinaNum as String Dim NumDigit (1) as String, numChar (1) as String Dim AfterDotNum AS String, NewNum As Double, Strnum As String Dim Reppostnum As Variant, I as Integer, RepNum (1) Dim Moenynum as Variant, Dotsite as Integer Numdigit (0) = "0 千 0 百 0 10 billion 0 thousand 0 hundred 0 10,000 0 thousand 0 hundred 0 ten "Numdigit (1) =" 0 仟 0 佰 0 picked up 200 million 0 仟 0 pick 0 million 0 仟 0 佰 0 拾 0 yuan 0 angle 0 points "Numchar (0) = "Zero one two three four five six seven eight ninety" Numchar (1) = "Zero Zhai 叁 肆 柒捌 柒捌" repnum (0) = array ("zero ten", "zero", "千 "," zero zero "," zero zero ") repnum (1) = array (" Zero Pick "," Zero "," Zero "," Zero "," Zero "," Zero " ) Reppostnum = array ("万", "亿", "zero") if Dotnum> 8 Then Dotnum = 8 Orgnum = formatNumber (ORGNUM, DOTNUM,,, VBFALSE) IF ismoney the newnum = Repla CE (Format (ORGNUM, "############),". "," ") Else newnum = int (orgnum) end if strnum = format (newnum, right (Numdigit) Ismoney), 2 * LEN (Trim (newun) - 1 ismoney)) for i = 0 to 10 strnum = Replace (Strnum, I, MID (Numchar (Ismoney), i 1, 1) Next I for i = 0 to Ubound (ismoney) Strnum = Replace (Strnum, Repnum (ISMONEY) (I), Left (ISMOMONEY) (I), 1)) NEXT I for i = 0 to 1 ismoney Strnum =

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

New Post(0)