CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 37 of 39 FirstFirst ... 27343536373839 LastLast
Results 541 to 555 of 580

Thread: Crystal Report

  1. #541
    Join Date
    Feb 2004
    Location
    Chennai
    Posts
    3
    Hi,

    How to view the reply for my question posted. I got a mail that Cimperiali has replied for my question. I want to see the contents.

    Regards,
    Deepak.
    Deepak.
    deepak_iyengar72@rediffmail.com

  2. #542
    Join Date
    Feb 2004
    Posts
    3

    Problem in CR

    Hi Mr. Babu & everyone

    Please guide me proper that I want to generate a report with multi_tables.

    Suppose I have 3 tables like tables whose names are Men, Women,Childs. There three tables data should be listed in a report. When 1st table data is completed a parameter passed from Vb should be printed and so on.

    Attachment file is here for more clear.

    How can I do at runtime from VB

    Thanx in Advance
    Attached Files Attached Files

  3. #543
    Join Date
    Feb 2004
    Location
    Philippines
    Posts
    58

    Exclamation Crystal Reports problem

    Sir Babu,

    Im just new in using Crystal Reports.... would u give me a snippet of code in accessing the Report Designer Component (RDC). My main platform is VC but i understand VB... my real problem is the query attach to the report (that can be seen in Show SQL).
    sample:
    select own_ln, own_fn
    from
    db2inst1.own_names own_names

    <db2inst1 is the owner of the table and also owner of the database, we were just given a schema access to use the database and tables as well>

    when i run the program <my UserID is ProgI>, a message box saying "ProgI.own_names" is undefined name.... what seems to be the problem? hope u can give me samples that may modify the setting of the report file at runtime or dynamically.

    By the way, im using DB2 as backend

    thanks....

  4. #544
    Join Date
    Feb 2004
    Posts
    2

    Visual Basic.NET + Crystal Reports 9

    I post the error codes first.

    Imports CrystalDecisions.CrystalReports.Engine
    'Namespace or type 'Engine' for the Imports 'CrystalDecisions.CrystalReports.Engine' cannot be found.

    Imports CrystalDecisions.Shared
    'Namespace or type 'Shared' for the Imports 'Imports CrystalDecisions.Shared' cannot be found.

    Imports CrystalDecisions.Web.Design
    'Namespace or type 'Design' for the Imports 'CrystalDecisions.Web.Design' cannot be found.

    Dim rpt As CrystalReport_item
    'Type 'CrystalReport_item' is not defined.

    rpt = New CrystalReport_item()
    'Type 'CrystalReport_item' is not defined.



    I have VB.NET Standard Version 2002. Then I bought Crystal Reports Version 9 in order to print reports. (Note that I don't have Visual Studio.NET, so this is not the embeded Crystal Reports in Visual Studio.NET)
    First, I install the VB.NET. Second, I install the Crystal Reports. (I just select normal installation, not customize intallation)
    After installation, I create and save a Crystal Reports called "CrystalReport_item" using the Crystal Reports software.
    I move the "CrystalReport_item.rpt" to the folder of my solution.
    Then at the VB.NET software, I click "Project->Add Existing Item...". Then I click the "CrystalReport_item.rpt" and click "Open" in order to add it to the solution.
    Then I type the code
    "Dim rpt As CrystalReport_item"
    in a new form's button1.click.
    However, there is a line under the "CrystalReport_item" and there is a yellow box telling that "Type 'CrystalReport_item' is not defined.".
    Firstly, I think that I forget to import libraries, then I type the code
    "Imports CrystalDecisions.CrystalReports.Engine".
    However, there is a line under the "CrystalDecisions.CrystalReports.Engine" and there is a yellow box telling that "Namespace or type 'Engine' for the Imports 'CrystalDecisions.CrystalReports.Engine' cannot be found.".
    Can you please tell me what I need to do in order to add the report to my solution and let it print the report?
    Please tell me more detailly as I am just a beginner of VB.NET and Crystal Reports 9. Thanks a lot.

  5. #545
    Join Date
    Feb 2004
    Posts
    2
    Sorry, forget to say hi first.
    Hi, everybody.
    Hope that Mr. K.Babu and other people can help me.
    Thanks again.
    ^^

  6. #546
    Join Date
    Oct 2003
    Location
    Merate-North Italy
    Posts
    230

    Printer Jokes

    I have a strange problem with a report in Crystal 8.0.

    This report is used from a MFC application wich creates a temp table with a customized name to allow multiple user access.
    So the reports works wonderfully on every kind of PC and every kind of printer settings. And also i have many applications reporting on temporary tables both in VB and VC++, and all these work perfectly.

    But I have a single application doing a strange joke on a single PC and a single Printer.

    When the user prints on the Epson4000 the printer defaults loading paper from the mail envelopes dish instead of the "A4" paper dish.

    But this problem doesn't occour if the report is another one.

    Note: all the rpt files I use got the same printer and page settings.

    The code I use is:
    Code:
    	m_Crystal1.Reset();
    	m_Crystal1.SetReportFileName(path);
    	m_Crystal1.SetSelectionFormula(Sel);
    	m_Crystal1.SetWindowTitle("Print");
    
    	m_Crystal1.SetFormulas(1, (LPCTSTR)("Title = " + Title));
    	
    	m_Crystal1.SetWindowAllowDrillDown(TRUE);
    	m_Crystal1.SetWindowShowNavigationCtls(TRUE);
    	m_Crystal1.SetWindowShowCancelBtn(TRUE);
    	m_Crystal1.SetWindowShowPrintBtn(TRUE);
    	m_Crystal1.SetWindowShowExportBtn(TRUE);
    	m_Crystal1.SetWindowShowZoomCtl(TRUE);
    	m_Crystal1.SetWindowShowCloseBtn(TRUE);
    	m_Crystal1.SetWindowShowProgressCtls(TRUE);
    	m_Crystal1.SetWindowShowSearchBtn(TRUE);
    	m_Crystal1.SetWindowShowPrintSetupBtn(TRUE);
    	m_Crystal1.SetWindowShowRefreshBtn(TRUE);
    	m_Crystal1.SetWindowState(2);
    	m_Crystal1.SetConnect(pApp->m_StrConCrw);
    
    	// load up a ##temp table
    	m_Crystal1.SetSQLQuery(Temp);
    
    	m_Crystal1.SetDestination(0);
    
    	BeginWaitCursor();
    	m_Crystal1.PrintReport();
    	EndWaitCursor();
    ++++++++[>++++++++<-]>+.<+++[>++++<-]>+.<++[>-----<-]>.<+++[>++++<-]>++.<+++[>----<-]>-.----.
    God does not play dice with the universe.(A.Einstein)

  7. #547
    Join Date
    Feb 2004
    Posts
    1

    Radar Chart

    Hi,
    I am trying to create a radar chart. Now the radar chart I can draw lines on the sum of a column values. But my requirement is draw the lines depending on another column value. This should translate into multiple lines.

    Any suggetions?

  8. #548
    Join Date
    Aug 2003
    Location
    London
    Posts
    515

    Change Report Currency Format Error

    I'm trying to change the currency format of a report at runtime, here is some of the code...


    Code:
    Private Sub SetReportFormat(crReport As CRPEAuto.Report)
    
        Dim objSections         As CRPEAuto.Sections
        Dim objSection          As CRPEAuto.Section
        Dim objReportObjects    As CRPEAuto.ReportObjects
        Dim objTextBox          As CRPEAuto.TextObject
        Dim X                   As Integer
    
    '// Get an object to represent each of the report sections
        Set objSections = crReport.Sections
        
    '// Begin loop for each section in the report
        For Each objSection In objSections
            
    '// Get an object to represent each of the objects in the report section
            Set objReportObjects = objSection.ReportObjects
            
    '// For each individual object in the report objects collection...
            For X = 1 To objReportObjects.Count
            
    '// If the object is a text box...
                If objReportObjects.Item(X).Kind = crTextObject Then
                    
    '// Get an object-reference to the text box...
                    Set objTextBox = objReportObjects.Item(X)
                    
    '// If the text box is a currency field, then change the currency to
    '// the new format
                    If objTextBox.Format = "Currency" Then
                        objTextBox.Format = GetCurrencyFormat
                    End If
                  
    '// Destroy this within loop...
                    Set objTextBox = Nothing
                  
                End If
            Next
        Next
        
    '// Clean up
        Set objTextBox = Nothing
        Set objReportObjects = Nothing
        Set objSections = Nothing
    
    End Sub
    However, I get a 'Feature Not Enabled' error on the following line...

    objTextBox.Format = GetCurrencyFormat

    {GetCurrencyFormat is just a function that returns a string - e.g; £#,##0.00;(£#,##0.00)}

    Any ideas? I tried to manipulate other propeties of the object but they all generate the same error??

    Thanks

  9. #549
    Join Date
    Feb 2004
    Posts
    1

    Question Linkes Pictures in CR10

    Hi,

    I hope someone can help me with the following problem.

    have a SQL-Server table which contains eight string fields with links to pictures which need to be shown on the report. These str255 fields can sound like "//blabla/pic/test1.jpg" and I really need to get them into the report without storing the pic in the database (we talk about 100 of Gigabytes of pictures).

    Thx in advance,

    Simon

  10. #550
    Join Date
    Dec 2003
    Posts
    9
    Hi K. Babu and Evryone,I have a problem to pass value to Stored Procedure parameter with crystal report RAS,this case happen when I use "Execute" command on my stored procedure that to control some parameter based on user input, but it shows an error when i Put the parameter in "Order By" clause....
    The value for the parameter seems to be empty. this is my code :

    Create Procedure RPT_PRint
    @OrderBy varchar(50),
    @SortOrder varchar(50)
    as

    exec(' Select
    AbsenceCode,
    AbsenceName
    from Absence_T
    order by '+@OrderBy+' '+@SortOrder)
    Go

    It comes weird, cause when i try to input the value on the crystal report designer it works fine, but when i pass the value from ASP page it won't show the report.....show error message " Syntax error near By"

  11. #551
    Join Date
    Mar 2004
    Posts
    1

    Crystal Report can't run from VB

    hallo...K.Babu..

    any idea how to solve my problem, descr as below;

    I want to run a report ( Crystal Report 7.0) from my program
    (code in VB 6.0).
    But when I click a print button this error msg was appear ;
    errMsg "Invalid report file name"

    This are code of my program ;
    Private Sub cmdPrint_Click()

    On Error GoTo EmpPerDeterr
    Cr.Action = 1

    Cr.Reset
    Cr.ReportTitle = "Catatan Aduan Pegawai MPSJ"
    Cr.WindowState = crptMaximized
    Cr.WindowTitle = "Catatan Aduan Pegawai MPSJ"
    Cr.WindowShowGroupTree = True


    Cr.Datafile(0) = App.Path & "\aswa.mdb"
    Cr.ReportFileName = App.Path & "\Reports\Aduan.rpt"
    Cr.Destination = crptToWindow
    Cr.WindowShowRefreshBtn = True
    Cr.WindowShowPrintBtn = True

    Exit Sub

    EmpPerDeterr:
    MsgBox Err.Description, vbOKOnly, "OASYS"

    End Sub

  12. #552
    Join Date
    Aug 1999
    Location
    India, TamilNadu, Chennai.
    Posts
    269

    Re: Crystal Report can't run from VB

    Hi,

    action property should be at last line of all the cr.{properties}

    cr.action = 1

    yours friendly,
    K.Babu

    Originally posted by pianme
    hallo...K.Babu..

    any idea how to solve my problem, descr as below;

    I want to run a report ( Crystal Report 7.0) from my program
    (code in VB 6.0).
    But when I click a print button this error msg was appear ;
    errMsg "Invalid report file name"

    This are code of my program ;
    Private Sub cmdPrint_Click()

    On Error GoTo EmpPerDeterr
    Cr.Action = 1

    Cr.Reset
    Cr.ReportTitle = "Catatan Aduan Pegawai MPSJ"
    Cr.WindowState = crptMaximized
    Cr.WindowTitle = "Catatan Aduan Pegawai MPSJ"
    Cr.WindowShowGroupTree = True


    Cr.Datafile(0) = App.Path & "\aswa.mdb"
    Cr.ReportFileName = App.Path & "\Reports\Aduan.rpt"
    Cr.Destination = crptToWindow
    Cr.WindowShowRefreshBtn = True
    Cr.WindowShowPrintBtn = True

    Exit Sub

    EmpPerDeterr:
    MsgBox Err.Description, vbOKOnly, "OASYS"

    End Sub
    Please avoid sending emails to my personal mail:
    write your doubts as thread in Codeguru
    Crystal Reports Forum
    .

    This will help all people having similar matters, and will let people who know solutions on the specific topic
    share their knowledge.

    Visit my company web site (Qmax Test Equipments Private Limited)

    Yours friendly,
    K.Babu

  13. #553
    Join Date
    Aug 2003
    Location
    London
    Posts
    515
    Managed to solve my problem. Certain aspects of Crystal objects are not enabled, you can determine which ones they are by using the Crystal Object browser (CrystalExplorer.exe) located in your /sample/xtreme/browser directory.

    You can change the currency format of the report at run-time by calling the SetLocaleInfo API just before the report is opened.

    Code:
    '// APIs
        Private Declare Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA" _
                    (ByVal Locale As Long, _
                     ByVal LCType As Long, _
                     ByVal lpLCData As String, _
                     ByVal cchData As Long) As Long
    
        Private Declare Function SetLocaleInfo Lib "kernel32" Alias "SetLocaleInfoA" _
                    (ByVal Locale As Long, _
                     ByVal LCType As Long, _
                     ByVal lpLCData As String) As Long
                     
        Private Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long
    
        Private Const LOCALE_SCURRENCY          As Long = &H14
    
    
    Private Function GetUserLocaleInfo(ByVal dwLocaleID As Long, _
                                      ByVal dwLCType As Long) As String
        
        On Error GoTo Fail
    
        Dim sReturn         As String
        Dim nSize           As Long
        
    '// call the function passing the Locale type
    '// variable to retrieve the required size of
    '// the string buffer needed
        nSize = GetLocaleInfo(dwLocaleID, _
                              dwLCType, _
                              sReturn, _
                              Len(sReturn))
        
    '// if successful..
        If nSize Then
    
            sReturn = Space$(nSize)
            nSize = GetLocaleInfo(dwLocaleID, _
                                  dwLCType, _
                                  sReturn, _
                                  Len(sReturn))
            If nSize Then
                GetUserLocaleInfo = Left$(sReturn, _
                                          nSize - 1)
            End If
            
        End If
    
        Exit Function
    Fail:
    
    End Function
    
    Private Sub ChangeCurrencyFormat(NewFormat As String)
    
        Dim LCID As Long
        Dim lResult As Long
            
    '// Change the currency format in the LOCALE settings
        LCID = GetSystemDefaultLCID()
        lResult = SetLocaleInfo(LCID, _
                                LOCALE_SCURRENCY, _
                                NewFormat)
    
    End Sub
    
    Private Property Get LocaleCurrency() As String
    
        On Error GoTo Fail
    
        Dim LCID As Long
        LCID = GetSystemDefaultLCID()
        LocaleCurrency = GetUserLocaleInfo(LCID, LOCALE_SCURRENCY)
    
        Exit Property
    Fail:
    
    End Property
    So, you can query the current setting with the LocaleCurrency property, change to the required setting using ChangeCurrencyFormat with the desired format e.g. ChangeCurrencyFormat("£") or ChangeCurrencyFormat("€"), open your report, then change back to previous currency format.

    Any fields in the report defined with 'Use System Default Format' will now pick up the correct currency from Locale!

  14. #554
    Join Date
    Nov 2003
    Posts
    8

    Unhappy

    Hello K.babu and dear friends all around the world! Please help me to solve my problem. I want to format the rounding properties of a field number. For an example, I have this field [smallest_point] and another field number
    [ Price ] and I set the rounding properties of field [Price] by this formula (Crystal Syntax) - in Customize number formatting menu :

    IF {smallest_point} = 0.0001 THEN
    0.0001
    ELSE IF {smallest_point} = 0.01 THEN
    0.01
    ELSE IF {smallest_point} = 1 THEN
    1

    So why did the report send me this message : "Bad Formula Result" ?

    I have to set the decimal number by the smallest_point. Let's say if the smallest point is 0.01, then the rounding must be 0.01 and decimal properties must be 1.00, if smallest point = 0.0001 then the rounding must be 0.0001 and decimal properties must be 1.0000.

    How to solve this error ?

    Please note that I've changed the Decimal Properties of the field to with this formula :

    IF {smallest_point} = 0.0001 THEN
    1.0000
    ELSE IF {smallest_point} = 0.01 THEN
    1.00
    ELSE IF {smallest_point} = 1 THEN
    1

    THANKS TO ANYONE HELP ME!

  15. #555
    Join Date
    Oct 2003
    Location
    Merate-North Italy
    Posts
    230


    Why don't they open a Crystal Report Forum?

    It would be really very useful!!
    ++++++++[>++++++++<-]>+.<+++[>++++<-]>+.<++[>-----<-]>.<+++[>++++<-]>++.<+++[>----<-]>-.----.
    God does not play dice with the universe.(A.Einstein)

Page 37 of 39 FirstFirst ... 27343536373839 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured