Results 1 to 9 of 9

Thread: Can't find a guide.

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2011
    Posts
    15

    Can't find a guide.

    Anyone knows a comprehensive guide to generating Crystal Reports with SQL Server 2005 data through VB.Net without using any wizard, just codes? Also would help if includes designing the report and generating charts programatically. I tried Google and searched here but none of the results that came up fits the bill.

  2. #2
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,515

    Re: Can't find a guide.

    Do you mean not using the report wizard and report designer? I've seen this article http://p2p.wrox.com/crystal-reports/...-run-time.html

    Why would you want to manually code the entire report? Seems like a lot of work with nothing to gain.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2011
    Posts
    15

    Re: Can't find a guide.

    @wes4dbt
    Hi! Thanks for replying.

    I wanted a customized look, and the reports generated dynamically. The default look of the report I get when I just,

    Code:
    Dim CrystalReport1 As New CrystalReport1
    
    CrystalReport1.SetDataSource(dcr.Tables(0))
    CrystalReportViewer1.ReportSource = CrystalReport1
    CrystalReportViewer1.Refresh()
    sucks like hell. So I decided to just have everything coded instead so I could control everything.

    EDIT:

    Reading your link and concluding Microsoft is being an a55 again, maybe there are other ways to create a custom report... >.>
    Last edited by djmaca; Mar 27th, 2012 at 09:50 PM.

  4. #4

    Thread Starter
    New Member
    Join Date
    Jan 2011
    Posts
    15

    Re: Can't find a guide.

    Just an update:

    I find that I cannot edit, add or delete parameter fields programatically in Visual Studio 2008(vb.net). Is this it? So you cannot in anyway make parameter fields unless you do it manually?

    If it is, can anyone reccomend me something better than crystal reports?

  5. #5
    Hyperactive Member
    Join Date
    Jul 2010
    Location
    UK
    Posts
    288

    Re: Can't find a guide.

    I think you can. You can do it through Crystal or as in the thread before this one provides suggestion on setting up parameters.

    As for the default look sucks I don't really get it. As Wes said you don't need to code everything on the report but why not start of with a blank report, a blank canvas as such, and you can do whatever you want with it. I think you need to go step by step and describe what it is you are trying to achieve here.

    You can use other report writing tools such as SSRS but you will encounter similar issues.
    One day I found VB.
    Now I live in the state of Confusion.

  6. #6
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,515

    Re: Can't find a guide.

    If you Google ".Net crystal parameters runtime" you'll get lots of examples. Here's something to get you started, http://www.thescarms.com/dotnet/CrystalParms.aspx
    http://www.aspfree.com/c/a/ASP.NET/W...d-ASP-NET-2-0/

    If you want to create a report without a designer then you could use the PrintDocument component. I've never used it so I can't help with that.

  7. #7

    Thread Starter
    New Member
    Join Date
    Jan 2011
    Posts
    15

    Re: Can't find a guide.

    @C.A.

    Hi. OK so I needed my CR to be dynamic as in, in my main form, the user picks the table from a database in SQL Server, then choose a field as primary key(or reference, I really don't know the term used here), then choose other tables and fields for each table.

    The fields that I choose are only the ones that should appear in CR. Also, they should be long enough to display their values(because there are fields in the tables like "address" or "social security number"). I also would like to design the appearance(like location of text) programatically and generate only the necessary number of parameter fields.

    But when I try to:

    Code:
    CrystalReport1.ParameterFields.Capacity += 1
    It tells me that I cannot edit parameter fields this way and that I need to add them manually on the report.

    Also:

    Code:
    CrystalReport1.ParameterFields.Add(ParameterField1)
    Returns a "Not Supported" error.

    @wes4dbt

    Doesn't this assume you had added parameter fields already in the CR. Also the second link shows adding parameters manually. I need mine to be super flexible.

    Thanks guys.

  8. #8
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,515

    Re: Can't find a guide.

    If you would have read the complete article it show a lot more than adding parameters manually. Try, Googling "crystal add parameter runtime", there's lots of examples.

  9. #9

    Thread Starter
    New Member
    Join Date
    Jan 2011
    Posts
    15

    Re: Can't find a guide.

    Sorry Wes, but all the links provided assumed that I have parameter fields already in the Details Section and that I would only edit their properties/values.

    I wanted to add my parameter fields, text object, etc. programatically to the Details Section of the crystal report.

    Thanks anyway.

    P.S. I did read the article btw. All of it.
    Last edited by djmaca; Mar 28th, 2012 at 08:48 PM.

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