水晶报表中的公式 [英] Formula in Crystal Report

查看:78
本文介绍了水晶报表中的公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人

我仍然使用vb.net 2005创建程序.
当我想用水晶报表显示报表时.
数据不显示. :(
我使用CR 9进行报告.

这是我的代码

Dear All

I still create program with vb.net 2005
When i want show report with crystal report .
The data not show. :(
I use CR 9 for report.

This is my code

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports System.Data.SqlClient
Public Class frmReport
    Dim MyTable As CrystalDecisions.CrystalReports.Engine.Table
    Dim MyLogin As CrystalDecisions.Shared.TableLogOnInfo
    Dim rsAkses As ADODB.Recordset
    Dim RptUser As rptBeli
    Private Sub frmReport_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        ' Dim Ssql As String
        Dim strConnection As String = "server=posmi-child;database=IT_INVENTORY;uid=arjuna;pwd=wicaksono;"
        Dim Connection As New SqlConnection(strConnection)
        Dim strSQL As String = "Select * From T_PEMBELIAN WHERE NO_DOK='" & frmEquipment.TextBox1.Text & "'"
        Dim DA As New SqlDataAdapter(strSQL, Connection)
        Dim DS As New DataSet
        RptUser = New rptBeli
        For Each MyTable In RptUser.Database.Tables
            MyLogin = MyTable.LogOnInfo
            MyLogin.ConnectionInfo.Password = "wicaksono"
            MyLogin.ConnectionInfo.UserID = "arjuna"
            MyLogin.ConnectionInfo.ServerName = "POSMI-CHILD"
            MyLogin.ConnectionInfo.DatabaseName = "IT_INVENTORY"
            MyTable.ApplyLogOnInfo(MyLogin)
        Next
        DA.Fill(DS)
        CS.SelectionFormula = "{T_PEMBELIAN.NO_DOK}='" & frmEquipment.TextBox1.Text & "'"
        CS.ReportSource = RptUser
    End Sub
End Class



如果我在行中发表评论
"



If i give comment in line
''

CS.SelectionFormula = "{T_PEMBELIAN.NO_DOK}='" & frmEquipment.TextBox1.Text & "'"



数据显示,如果我取消注释,数据不显示
我的代码有什么问题
请帮帮我
谢谢
问候
Wicaksono



the data show, if i give uncomment the data not show
what''s wrong with my code
Please help me
Thanks
Regards
Wicaksono

推荐答案

在这里看看如何使用SelectionFormula创建Crystal报表:
使用选择公式创建报告 [
Have a look here of how to create a Crystal Report with SelectionFormula:
Creating a Report with a Selection Formula[^]

Might be the text filter need to be in double quotes and not single.


这篇关于水晶报表中的公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆