Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Crystal Reports Hell

Crystal Reports Hell

Scheduled Pinned Locked Moved Visual Basic
databasecsharpsharepointvisual-studiowinforms
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Len Miller
    wrote on last edited by
    #1

    I own a small-potatoes business developing software. I am working on a new WinForms product and need flexible reports with a min. budget. I chose Crystal Reports because it came with VS .NET ("free"). I never used the product before (questionable decision), but figured I could learn it. Anyway, my original grandiose plan required that reports: 1) Display data output from a stored procedure 2) Have fields disappear or drop-out from the report based on user's security level 3) Have dynamically built selection fields based on home-grown ad-hoc tool. It appears that #2 and #3 are impossible, or, maybe can only be accomplished if I use all formula fields, and create a report with 1 field, another with 2 fields, another with 3 fields… etc. Then however many fields I want in my report, I choose the appropriate fields count report? – YUK. I cannot even get #1 working!! * When I create the report, it appears I need an SQL command (or procedure) to generate fields. * I drag these fields onto the report. * The user builds a where clause via a tool I created, and an SP is run with appropriate results. * I assign the results to the report like this: rpt.Load() rpt.SetDataSource(ds) … OR … rpt.Database.Tables.Item(0).SetDataSource(ds) rptViewer.ReportSource = rpt * The data show is always whatever was returned from the query at DESIGN tim. The dataset assigned at run tim is ignored * I did see suggestions ion the web stating to “Uncheck Save Data With Report on the file menu”. I cannot find this option. ANY HELP? Thanks, -Len Miller "If I had eight hours to chop down a tree, I'd spend six sharpening my axe." -Abraham Lincoln

    N 1 Reply Last reply
    0
    • L Len Miller

      I own a small-potatoes business developing software. I am working on a new WinForms product and need flexible reports with a min. budget. I chose Crystal Reports because it came with VS .NET ("free"). I never used the product before (questionable decision), but figured I could learn it. Anyway, my original grandiose plan required that reports: 1) Display data output from a stored procedure 2) Have fields disappear or drop-out from the report based on user's security level 3) Have dynamically built selection fields based on home-grown ad-hoc tool. It appears that #2 and #3 are impossible, or, maybe can only be accomplished if I use all formula fields, and create a report with 1 field, another with 2 fields, another with 3 fields… etc. Then however many fields I want in my report, I choose the appropriate fields count report? – YUK. I cannot even get #1 working!! * When I create the report, it appears I need an SQL command (or procedure) to generate fields. * I drag these fields onto the report. * The user builds a where clause via a tool I created, and an SP is run with appropriate results. * I assign the results to the report like this: rpt.Load() rpt.SetDataSource(ds) … OR … rpt.Database.Tables.Item(0).SetDataSource(ds) rptViewer.ReportSource = rpt * The data show is always whatever was returned from the query at DESIGN tim. The dataset assigned at run tim is ignored * I did see suggestions ion the web stating to “Uncheck Save Data With Report on the file menu”. I cannot find this option. ANY HELP? Thanks, -Len Miller "If I had eight hours to chop down a tree, I'd spend six sharpening my axe." -Abraham Lincoln

      N Offline
      N Offline
      nguyenthai2010
      wrote on last edited by
      #2

      I only use Store Procedure to Edit data in SQL Server. You should use Commang SQL to Crystal Report, with Command: Public Function LayDuLieuDT(ByVal strSQL As String, ByVal table_name As String) As DataTable Try Dim oAdater As SqlClient.SqlDataAdapter Dim oTable As New DataTable Dim ds As New DataSet oAdater = New SqlClient.SqlDataAdapter(strSQL, strConn) oAdater.Fill(ds, table_name) oTable = ds.Tables(table_name) Return oTable Catch End Try End Function

      L 1 Reply Last reply
      0
      • N nguyenthai2010

        I only use Store Procedure to Edit data in SQL Server. You should use Commang SQL to Crystal Report, with Command: Public Function LayDuLieuDT(ByVal strSQL As String, ByVal table_name As String) As DataTable Try Dim oAdater As SqlClient.SqlDataAdapter Dim oTable As New DataTable Dim ds As New DataSet oAdater = New SqlClient.SqlDataAdapter(strSQL, strConn) oAdater.Fill(ds, table_name) oTable = ds.Tables(table_name) Return oTable Catch End Try End Function

        L Offline
        L Offline
        Len Miller
        wrote on last edited by
        #3

        Hi, Thanks for trying to answer my questions, but I am not sure what you are saying here. First, I DO use a stored procedure, and I want the dataet to be used at run time. This is my problem. Second, you provide a function that returns a datatable. That is not needed for what my questions / issues are. I have the problem where I specify OLEDB connection and a query at design time to specify my available fields. I drag these fields onto my report and save. Then at run time, I use the Crystal Reports Engine to specify the dataset (from my stored procedure results). But, the data always appears to be the result of the query specified at design time. I Searched the web, and saw instructions to uncheck "Save Report With Data". on the File menu. This does not exist. I suspect this suggestion only applies to the full product, and not the Visual Studeio .NET version. I had other issues too (Like how to dynamically make fields disappear based on app security priveledges, and whether a report can be built from scratc at run time, and whether Windows Authentication can be used / specified at RUN time) but this was my main problem. Thanks, -Len Thanks, -Len Miller "If I had eight hours to chop down a tree, I'd spend six sharpening my axe." -Abraham Lincoln

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups