Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 4th, 2007, 12:41 PM
Authorized User
 
Join Date: Feb 2007
Location: , Rio de Janeiro, Brazil.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help ASP with CE10

Hi,

I am with a problem when executing a report in the ASP, does not appear value in this report.
Somebody knows to say what this happening.

It follows the code:

Página que chama o relatório.
<%@ LANGUAGE="VBSCRIPT" %>


dim tPrograma
Dim cd_programa

cd_programa = Split(Request.item("cd_programa"), "|", 2, 1)
tPrograma = cd_programa(0)
reportname = "relatorio"
'####################### Crystal Enterprise 10 ##################
Dim objCE
Set objCE = New clsCE2
With objCE
If .LogonCrystal() = True Then
     If .getreport("pasta", reportname) = True Then
                Call .ConfigurarBD()
                Call .PassarParametros("P_TPROGRAMA", tPrograma)
                Call .PassarParametrosSub("Atividades", "P_TPROGRAMA", tPrograma)
                Call .PassarParametrosSub("Orcamentos", "P_TPROGRAMA", tPrograma)
                Call .callsReport()
      End If
End If
End With
Set objCE = Nothing
Session.CodePage=1252


Stretches of Classe clsCE.asp

Class clsCE2
    Private objSessionMgr
    Private objSessionCE
    Private objInfoStore

    Private objInfoObject
    Private objReportAppFactory
    Private objReportDocument

    Private m_IdRelatorio

    Public g_ServerBD
    public g_Banco
    Public g_UserBD
    Public g_PwdBD

    Public g_DataSource

    Public gstrParametros

    Public gParamsSub
    Private gCntParam

    private gstrFormula

Sub callsReport()

        'Declara ReportAppFactory e ReportDocument
        Dim rptFactory
        Dim rptDoc

        Set rptFactory = objSessionCE.Service("", "RASReportFactory")
        Set rptDoc = rptFactory.OpenDocument(CLng(m_IdRelatorio))

        On Error Resume Next

        Dim oDBInfo
        Dim pbLevel1
        Dim pbLevel2

        Set oDBInfo = rptDoc.DatabaseController.GetConnectionInfos().Ite m(0)

        Set pbLevel1 = oDBInfo.Attributes

        pbLevel1.Item("QE_ServerDescription") = g_ServerBD

        Set pbLevel2 = pbLevel1.item("QE_LogonProperties")
        With pbLevel2
          .Item("Data Source") = g_ServerBD
          .Item("Initial Catalog") = g_Banco
        End With
        Response.Write g_ServerBD & "<br>"
        Response.Write g_Banco & "<br>"

        pbLevel1.Item("QE_LogonProperties") = pbLevel2

        oDBInfo.Attributes = pbLevel1
        oDBInfo.UserName = g_UserBD
        oDBInfo.Password = g_PwdBD

        Response.Write g_UserBD & "<br>"
        Response.Write g_PwdBD & "<br>"
        ' CHANGING THE MAIN REPORT DATABASE INFO
        Dim Tables
        Dim newTable

        Set Tables = rptDoc.DataDefController.Database.Tables
        For Each table in Tables
          Set newTable = Table.Clone
          newTable.ConnectionInfo = oDBInfo
          newTable.QualifiedName = Table.Name
          rptDoc.DatabaseController.SetTableLocation table, newTable
        Next

        ' CHANGING THE DATABASE FOR ALL SUBREPORTS

        Set subReportNames = rptDoc.SubReportController.QuerySubreportNames
        For each subName in subReportnames

          Set subTables = rptDoc.SubReportController.GetSubreportDatabase(su bName).Tables

          For each subTable in subTables
            Set newSubTable = subTable.Clone
            newSubTable.ConnectionInfo = oDBInfo
            newSubTable.QualifiedName = subTable.Name
            rptDoc.SubReportController.SetTableLocation subName, subTable, newSubTable
          Next

        Next


        If Trim(gstrParametros) <> "" Then

            strValor = Mid(gstrParametros,1, Len(gstrParametros) - 1)
            arr_Parametros = Split(strValor, "|")

            gstrParametros = Mid(gstrParametros,1, Len(gstrParametros) - 1)

            Dim strNome
            Dim i, j
            For i = 0 to UBound(arr_Parametros)
                strNome = arr_Parametros(i)
                j = i + 1
                strValor = arr_Parametros(j)
                i = j

                rptDoc.DataDefController.ParameterFieldController. SetCurrentValue "", strNome, strValor
            Next
        End If
        If gParamsSub.Count > 0 Then
            Dim vItem
            Dim ind
            Dim vNomeSub
            Dim vNomeParam
            Dim vValorParam
            Dim bSetar
            Dim arr_ParametrosSub

            For Each vItem in gParamsSub
                arr_ParametrosSub = Split(gParamsSub.Item(vItem), "|")
                vNomeSub = arr_ParametrosSub(0)
                For ind = 1 to Ubound(arr_ParametrosSub)
                    If ind mod 2 = 1 Then
                        vNomeParam = arr_ParametrosSub(ind)
                    End If
                    If ind mod 2 = 0 Then
                        vValorParam = arr_ParametrosSub(ind)
                    End If
                Next
                rptDoc.DataDefController.ParameterFieldController. SetCurrentValue vNomeSub, vNomeParam, vValorParam
            Next
        End If

        If gstrFormula <> "" Then
            rptDoc.DataDefinition.RecordFilter = gstrFormula
        End If
        Response.ExpiresAbsolute = Now() - 1

        Response.ContentType = "text/html"
        Response.CharSet = "UTF-8"
        Session.CodePage = 65001

        Dim CrViewer1
        Set CrViewer1 = CreateObject("CrystalReports.CrystalReportInteract iveViewer")

        Dim BooleanSearchControl
        Set BooleanSearchControl = CreateObject("CrystalReports.BooleanSearchControl" )
        BooleanSearchControl.ReportDocument = rptDoc

        With CrViewer1
            .Name = "Crystal Reports Interactive Viewer"
            .IsOwnForm = True
            .IsOwnPage = True
            .IsDisplayGroupTree = False
            .HasToggleGroupTreeButton = True
            .BooleanSearchControl = BooleanSearchControl

            .ReportSource = rptDoc.ReportSource

            .EnterpriseLogon = Session("es")

            .ProcessHttpRequest Request, Response, null
        End With

    End Sub

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
send parameters from asp page to an asp.net form hastikeyvan ASP.NET 1.0 and 1.1 Basics 2 March 29th, 2008 01:32 AM
using asp.net web user control in asp 3.0 App i_shahid Classic ASP Professional 0 January 8th, 2008 07:32 AM
Upgrading ASP w/ SQLserver 2000 to ASP.NET w/2005 cJeffreywang ASP.NET 2.0 Basics 1 April 5th, 2007 11:30 PM
CE10 Report Viewer err cmbaxter Crystal Reports 2 October 7th, 2004 04:48 AM
Porting a sa,ple ASP CR viewer app to ASP.NET jhansen42 Crystal Reports 0 August 29th, 2003 10:26 AM



All times are GMT -4. The time now is 04:11 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.