2016-06-17 73 views
-1

我用我的表格中的值創建了一個Crystal Report。所有列都正確顯示,除了一個提前切斷的列。它應該說「測試10」,但「10」部分丟失。我連接到數據庫,但否決了代碼中的連接。在報告中被截斷的列文本

「10」部分是否因爲我的重寫而不顯示?或者是其他因素造成的?

Dim cryRpt As New ReportDocument() 
cryRpt.Load("Location\report.rpt") 

Dim cryRpttableLogoninfos As New TableLogOnInfos() 
Dim cryRpttableLogoninfo As New TableLogOnInfo() 
Dim cryRptConnectionInfo As New ConnectionInfo() 
Dim cryRptTables As Tables 

'para1 
Dim crParameterFieldDefinitions As ParameterFieldDefinitions 
Dim crParameterFieldDefinition As ParameterFieldDefinition 
Dim crParameterValues As New ParameterValues 
Dim crParameterDiscreteValue As New ParameterDiscreteValue 
crParameterDiscreteValue.Value = value 
crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields 
crParameterFieldDefinition = crParameterFieldDefinitions.Item("@parameter") 
crParameterValues = crParameterFieldDefinition.CurrentValues 
crParameterValues.Clear() 
crParameterValues.Add(crParameterDiscreteValue) 
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues) 

'para2 
Dim crParameterFieldDefinitions1 As ParameterFieldDefinitions 
Dim crParameterFieldDefinition1 As ParameterFieldDefinition 
Dim crParameterValues1 As New ParameterValues 
Dim crParameterDiscreteValue1 As New ParameterDiscreteValue 
crParameterDiscreteValue1.Value = value 
crParameterFieldDefinitions1 = cryRpt.DataDefinition.ParameterFields 
crParameterFieldDefinition1 = crParameterFieldDefinitions1.Item("@parameter1") 
crParameterValues1 = crParameterFieldDefinition1.CurrentValues 
crParameterValues1.Clear() 
crParameterValues1.Add(crParameterDiscreteValue1) 
crParameterFieldDefinition1.ApplyCurrentValues(crParameterValues1) 

cryRptConnectionInfo.ServerName = servername 
cryRptConnectionInfo.DatabaseName = databasename 
cryRptConnectionInfo.UserID = userid 
cryRptConnectionInfo.Password = password 
cryRptConnectionInfo.IntegratedSecurity = False 

cryRptTables = cryRpt.Database.Tables 
For Each CrTable As CrystalDecisions.CrystalReports.Engine.Table In cryRptTables 
cryRpttableLogoninfo = CrTable.LogOnInfo 
cryRpttableLogoninfo.ConnectionInfo = cryRptConnectionInfo 
CrTable.ApplyLogOnInfo(cryRpttableLogoninfo) 
Next 

cryRpt.RecordSelectionFormula = "{table.value} = " & value 
+0

我改變了報告上的數據庫連接,並禁用了vb.net中的代碼,該代碼否決了連接,但它仍然存在? – AntoonVs

回答

1

在報告查看器,

I>選擇其中UR '測試10' 的數據示出了標籤..

II>寫點擊該拉布勒和選擇字段格式選項..

iii>在第一個選項卡中,選中「Can Grow」選項。

+0

Tanx m8你在哪裏賴其工作,但它總是在對象的第二行上你知道我怎麼能保持它的第一行有足夠的空間。 – AntoonVs

+0

試圖增加整個空間上的標籤的寬度.. –

+0

我增加了整個頁面的標籤,但它仍然把數字放在第二個規則任何idee – AntoonVs