程序问答   发布时间:2022-06-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Query from two tables in report大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决Query from two tables in report?

开发过程中遇到Query from two tables in report的问题如何解决?下面主要结合日常开发的经验,给出你关于Query from two tables in report的解决方法建议,希望对你解决Query from two tables in report有所启发或帮助;

In Crystal report wizard, locate your odbc created with username and password.

Then you will see a Command text, You can put your query in there.

This code for VB.NET

 Private CRPT As New Reportdocument
    Private APPPATH As String
    Private ParaM As New ParameterFIElds
    Public ParaM_DESC As New ParameterdiscreteValue
    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

        APPPATH = Application.StartupPath & "\REPORT\sample.rpt"
        CRPT.Load(APPPATH)
        Me.CrystalReportVIEwer1.Reportsource = CRPT

        ParaM = CRPT.ParameterFIElds

        ParaM_DESC.Value = Format(DatePicker1.Value, "yyyymMdd")
        ParaM("DATEP").CurrentValues.Clear()
        ParaM("DATEP").CurrentValues.Add(ParaM_desc)
        Me.CrystalReportVIEwer1.@R_607_7017@h()
    End Sub

This code is for C#:

CRPT = new Reportdocument();
            APPPATH = Environment.CurrentDirectory + "Sample.rpt";
            CRPT.Load(APPPATH);
            Report_VIEwer.@R_607_7017@h();
            CRPT.SetParameterValue("syear", Servercls.year);


            CRPT.SetParameterValue("smonth", Servercls.month);
            CRPT.SetParameterValue("sday", Servercls.day);
            CRPT.SetParameterValue("datevalue", Servercls.Datevalue);
            Report_VIEwer.Reportsource = CRPT;

            sc.configureCrystalReport();
            Report_VIEwer.@R_607_7017@h();

Your crystal report parameter name must be the same with in your Code Behind.

解决方法

@H_872_2@my VB application prints a report via ODBC. I added the tables using database
expert and designed the Crystal Report. Where do I put my query? here is my
query

SELECT ts.`scheDIDNO`,ts.`DAYNAME`,DATE_FORMAT(ts.`timestART`,'%h:%i %p') as timestART,DATE_FORMAT(ts.`TIMEEND`,'%h:%i %p') as TIMEEND,ts.`GRADELEVEL`,ts.`SECTIONNAME`,ts.`SUBjeCTNAME`,ts.`FACFULLNAME`,ts.`ROOmname`,tf.`FACFULLNAME` as PERSONNEL,tf.`DEPARTMENT`,tse.`Adviser`
FROM `tblschedule` ts,`tblfaculty` tf,`tblsection` tse
WHERE ts.`GRADELEVEL` = " & lblgrade.Text & "
    AND ts.`SECTIONNAME` = '" & lblsect.Text & "'
    AND ts.`DEPARTMENTNAME` = tf.`DEPARTMENT`
    AND tf.`ADMINISTRATOR` = 1
    AND tse.`SECTIONNAME` = '" & lblsect.Text & "'

Query from two tables in report

大佬总结

以上是大佬教程为你收集整理的Query from two tables in report全部内容,希望文章能够帮你解决Query from two tables in report所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。