Pass Session Variable Value to Crystal Report?

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Pass Session Variable Value to Crystal Report?

    I've got an aspx page that allows the user to select different options
    whenever they want to run a report. On this page, I have added an
    additional text box for the user to enter in comments about the report
    they are running.

    I would like to be able to have the comments that the user has entered
    to appear on the report that is generated. I thought that I might be
    able to pass this text to the report by using a session variable but I
    have had no luck. It doesn't matter if I use a session variable to
    accomplish this.

    Can someone tell me how I can the user's comments from the web form
    appear on the report?

    Thanks!
    crjunk Guest

  2. Similar Questions and Discussions

    1. How to display Crystal Report
      Hi all, I dont know how to display a parameterized Crystal report in Asp.Net page... e.g. I give input of Student Code range and then click on View...
    2. Pls Hlp : crystal report
      Hi, Am getting the following error: cpeaut32 error '800a753c' Invalid enum value. & the code is as follows : set MyParam = ...
    3. ASP + Crystal Report 9
      I am beginner on Crystal Report. I want to ask a basic question. How can i display a report in ASP? I search for many web and try the sample...
    4. how to pass a password to crystal report 9.0 from vb6.0??!
      Is there any way passing a password to crystal report 9.0 from Visual Basic 6.0. so that when loading the report in vb6.0., it can connect to the...
    5. IS it better to use session variables or pass a URL variable
      Yes, I am sure the answer starts with - It depends... Well, I am trying to get a person's name from one page to the next. The name will obviously...
  3. #2

    Default Re: Pass Session Variable Value to Crystal Report?

    I figured out a way to accomplish this. I created a session variable
    named UComments and stored the text that the user typed in it. On my
    Crystal Report I created a blank formula field named UserComments I
    next added the following code to my web form:

    Dim oRpt As CrystalDecisions.CrystalReports.Engine.ReportDocum ent
    = New CrystalDecisions.CrystalReports.Engine.ReportDocum ent()

    '*** TELLING THE PROGRAM WHER THE REPORT IS LOCATED
    '*** AND WHAT THE REPORT'S NAME IS. ***
    oRpt.Load(Session("ReportLocation") & "Grant.rpt")

    '*** CODE TO WRITE USER'S COMMENTS TO THE REPORT. ***
    oRpt.DataDefinition.FormulaFields.Item("UserCommen ts").Text = "'"
    + Trim(Session("UComments")) + "'"

    CrystalReportViewer1.ReportSource = oRpt


    [email]crjunk@earthlink.net[/email] (crjunk) wrote in message news:<e45e90aa.0308061021.788041e6@posting.google. com>...
    > I've got an aspx page that allows the user to select different options
    > whenever they want to run a report. On this page, I have added an
    > additional text box for the user to enter in comments about the report
    > they are running.
    >
    > I would like to be able to have the comments that the user has entered
    > to appear on the report that is generated. I thought that I might be
    > able to pass this text to the report by using a session variable but I
    > have had no luck. It doesn't matter if I use a session variable to
    > accomplish this.
    >
    > Can someone tell me how I can the user's comments from the web form
    > appear on the report?
    >
    > Thanks!
    crjunk Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139