[Crystal Report] Skills

xiaoxiao2021-03-06  50

1. How do I make a page? Add a numeric field PAGENO to DataTable. In the code, the record is assigned to this field, from 1 to 1, the number is full of 10 auto reduction to 1. Then use this field PAGENO group in the crystal report, right-click the group header in the menu, select "Format Festival ..." and hook "In the Back page New page", then add "Run Summer Field" will require small The field is placed on the footer. Add a numeric field PAGENO to DataTable. In the code, the record is assigned to this field, from 1 to 1, the number is full of 10 auto reduction to 1. Then use this field PAGENO group in the crystal report, right-click the group header in the menu, select "Format Festival ..." and hook "In the Back page New page", then add "Run Summer Field" will require small The field is placed on the footer.

2. A page is not displayed, how to add a blank record?

Add it in DataTable, using Pageno statistics to reach 10 per page record.

3. How to convert the page subtitle into a capital amount?

Add the formula field, right key "Edit", change the syntax in the formula editor for Basic, and add the following code:

DIM LowerMoney As Currency LowerMoney = Round ({#total_psje}, 2)

Dim strLower As String, strUPart As String, strUpper As String Dim iTemp As Number strLower = cStr (LowerMoney) 'to two decimal places reserved strLower = Replace (strLower, "¥", "") strLower = Replace (strLower, "," , "") Itemp = 1 strupper = ""

Do while (itemp <= len (strlower)) Select Case MID (Strlower, Len (Strower) - Itemp 1, 1) Case "." Strupart = "Yuan" Case "0" strupart = "zero" Case "1" Strupart = "" Case "2" strupart = "" case "3" strupart = "" case "4" strupart = "" case "5" strupart = "Wu" Case "6" strupart = "land" Case "7" Strupart = "柒" Case "8" Strupart = "捌" Case "9" Strupart = "玖" End Select SELECT CASE ITEMP CASE 1 Strupart = Strupart & "Division" Case 2 Strupart = Strupart & "Corner" Case 3 Strupart = Strupart & "Case 4 Strupart = Strupart &" Case 5 Strupart = Strupart & "Pick up" Case 6 Strupart = Strupart & "" case 7 strupart = Strupart & "" case 8 strupart = Strupart & "10,000" case 9 strupart = strupart & "Pick" Case 10 Strupart = Strupart & "" case 11 strupart = strupart & " thousand"

Case 12 strUPart = strUPart & "one hundred million" Case 13 strUPart = strUPart & "pick up" Case 14 strUPart = strUPart & "Bai" Case 15 strUPart = strUPart & "thousand" Case 16 strUPart = strUPart & "Wan" Case Else strUPart = strUPart & "End select strupper = strupart & struner Itemp = itemp 1 loop Strupper = Replace (Strupper," Zero "," Zero ") Strupper = Replace (Strupper," Zero "," Zero ") Strupper = Replace Strupper, "zero", "zero") STRUPPER = Replace (Strupper, "Zero Zero", "zero") STRUPPER = Replace (Strupper, "Zero Zero", "Zero") Struppper = Replace (Strupper, "Zero Corner zero, "whole") STRUPPER = Replace (Strupper, "Zero", "whole") Strupper = Replace (Strupper, "Zero", "Zero") Struppper = Replace (Strupper, "qiyi Zero Yuan, "100 million") STRUPPER = Replace (Strupper, "100 million yuan", "100 million yuan") Strupper = Replace (Strupper, "1.0 million", "100 million") Strupper = Replace (Strupper , "零 元", "10,000 yuan") STRUPPER = Replac e (Strupper, "10,000 yuan", "10,000 yuan") Strupper = Replace (Strupper, "1.0 million", "100 million") STRUPPER = Replace (Strupper, "万", "10,000") Strupper = Replace (Strupper , "Zero Yuan", "Yuan") Strupper = Replace (Strupper, "Zero", "Zero") 'Handling IF below (MID (Strupper, 1, 1) = "Yuan"

) THEN STRUPPER = MID (STRUPPER, 2, (LEN (STRUPPER) - 1)) IF (MID (Strupper, 1, 1) = "zero") THEN STRUPPER = MID (Strupper, 2, (Len (STRUPPER) - 1 )) IF (Strupper, 1, 1) = "angle") THEN STRUPPER = MID (Strupper, 2, (Len (Strupper) - 1)) IF (MID (Strupper, 1, 1) = "points") THEN STRUPPER = MID (Strupper, 2, (Len (Strupper) - 1)) IF (MID (Strupper, 1, 1) = "whole") THEN STRUPPER = "Zero Yuan" formula = struner4. How to change the report A TEXT value? Using crystaldecisions.crystalreports.crystalreports.crystalReports.Engine;

public void _SetReportTextObjectValue (string TextObjectCtrlName, string Value) {ReportDocument rd = (ReportDocument) this.crystalReportViewer1.ReportSource; TextObject o = (TextObject) rd.ReportDefinition.ReportObjects [TextObjectCtrlName]; o.Text = Value;}

5. Update the display report?

Using crystaldecisions.crystalreports.Engine;

ReportDocument rpt = new reportDocument (); rpt.load; rpt.setDataSource; this.crystalReportViewer1.Reportsource = RPT;

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

New Post(0)