473,659 Members | 3,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

parameter ignored for ExportToStream .NET

Hello All

I am having a very hard timt exporting crystal report to PDF document
in my ASPX page. I am able to generate the PDF document , but the i
am not able to pass the parameter to the report (Crystal). It looks
like , it completely ignores the parameter i am passing and just
brings all the records from the database.
When i run the report directly from Crystal , it works fine. So I
know report works fine . For some strange reason , the parameter i
am passing are not applied to the report.
Can anyone share your ideas of how to do this !!!.. Thank you

Here is the code

Dim SActivityID As Long = 0
Dim iAppUserId As Long = 0
Dim myReport As ReportDocument = New ReportDocument
Dim s As Stream
Dim crConnectionInf o As CrystalDecision s.Shared.Connec tionInfo
Dim pDv As ParameterDiscre teValue = New ParameterDiscre teValue
Dim crTable As CrystalDecision s.CrystalReport s.Engine.Table
Dim crTables As CrystalDecision s.CrystalReport s.Engine.Tables
Dim crTableLogOnInf o As CrystalDecision s.Shared.TableL ogOnInfo
Dim crDatabase As
CrystalDecision s.CrystalReport s.Engine.Databa se
Dim parameterFieldD ef As ParameterFieldD efinition
Dim parameterValues As ParameterValues
Dim ExpOptions As ExportOptions
Dim req As ExportRequestCo ntext
iAppUserId = CLng(Session("S SXYUser_ID"))
If Not IsPostBack Then
If iAppUserId <= 0 Then
Response.Redire ct("Login.aspx" )
Response.ClearH eaders()
Else

crConnectionInf o = New
CrystalDecision s.Shared.Connec tionInfo
crConnectionInf o.ServerName = "XXXXXX"
crConnectionInf o.DatabaseName = "YYYYYYYYYY Y"
crConnectionInf o.UserID = "NO"
crConnectionInf o.Password = "VVVVVVVV"

myReport.Load(" c:\\inetpub\\ww wroot\\XZY\\Spe cimenReport.rpt ")
crDatabase = myReport.Databa se
crTables = crDatabase.Tabl es

For Each crTable In crTables
crTableLogOnInf o = crTable.LogOnIn fo
crTableLogOnInf o.ConnectionInf o = crConnectionInf o
crTable.ApplyLo gOnInfo(crTable LogOnInfo)
Next

SActivityID = CLng(Request.Pa rams("SpecimenA ctID"))
Response.ClearH eaders()
Response.ClearC ontent()
Response.Conten tType = "applicatio n/pdf"
pDv.Value = SActivityID

parameterFieldD ef =
myReport.DataDe finition.Parame terFields("Spec imenActId")
parameterValues = parameterFieldD ef.CurrentValue s
parameterValues .Add(pDv)
parameterFieldD ef.ApplyCurrent Values(paramete rValues)

req = New ExportRequestCo ntext
ExpOptions = New ExportOptions
ExpOptions.Expo rtFormatType =
ExportFormatTyp e.PortableDocFo rmat
ExpOptions.Form atOptions = New PdfRtfWordForma tOptions

req.ExportInfo = ExpOptions

s = myReport.Format Engine.ExportTo Stream(req)
Response.ClearH eaders()
Response.ClearC ontent()
Response.Conten tType = "applicatio n/pdf"

Dim buffer(s.Length ) As Byte
s.Read(buffer, 0, Int(s.Length))
Response.Binary Write(buffer)
Response.End()
End If
Nov 20 '05 #1
0 1014

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1901
by: Radx | last post by:
Hello All I am having a very hard timt exporting crystal report to PDF document in my ASPX page. I am able to generate the PDF document , but the i am not able to pass the parameter to the report (Crystal). It looks like , it completely ignores the parameter i am passing and just brings all the records from the database. When i run the report directly from Crystal , it works fine. So I know report works fine . For some strange...
0
1253
by: baumann | last post by:
hi all, Nontype template parameters are declared much like variables, but they cannot have nontype specifiers like static, mutable, and so forth. They can have const and volatile qualifiers, but if such a qualifier appears at the outermost level of the parameter type, it is simply ignored: template<int const length> class Buffer; // const is useless here template<int length> class Buffer; // same as previous
4
1316
by: Michael C | last post by:
I was looking over some code that calls a stored procedure from C#. I have specified one more parameter than necessary but the code still works. Does anyone know why it works? This is on a PDA connecting to SQLServer. Thanks. eg sqlCommand command = new SqlCommand(connection, "INSERT INTO SomeTable (A,B,C) VALUES (@A, @B, @C)");
0
1056
by: ashok.ponnusamy | last post by:
hi, i was created crystal report in my aspx. it's work fine. but i want to change the parameter value by selecting value from dropdownlist in the aspx page. First time it's work fine.second time when i pass different data it's shows the previous Report data only not new one. I am using stored procedure to Get report my code is something like this
5
1695
by: Roy Smith | last post by:
I've got some legacy code I'm maintaining. There's a method declared in the class.h file like this: void foo(unsigned priority); and it's implemented as: void myClass::foo (unsigned /* priority */) { // body omitted
1
1973
by: gglegrp112 | last post by:
Is it possible to send an array as a parameter for an execute method in dbapi2 module? I'm using adodbapi and try to perfrom the following SQL query: select * from item where storeid in ('01', '02') When I use direct string formating it works: a=('01','02')
0
1802
by: lrobo01 | last post by:
I'm having a problem with Crystal report.net with ASP.NET. The problem occurs when exporting the report. The report uses a discrete parameter with multiple values. When the report is loaded into the crystal report view it shows all the values from the discrete parameter. But when I export the report it only shows the values from the last discrete parameter value enter. My code is listed below:
0
2803
by: lrobo01 | last post by:
I'm having a problem with Crystal report.net with ASP.NET. The problem occurs when exporting the report. The report uses a discrete parameter with multiple values. When the report is loaded into the crystal report view it shows all the values from the discrete parameter. But when I export the report it only shows the values from the last discrete parameter value enter. My code is listed below:
1
5947
by: harikrish | last post by:
HI im facing a problem that when i export my crystal reports to pdf format using ReportDocument object's ExportToStream method, it led me the error message that Method 'ISCREditableRTFExportFormatOptions_reserved5' on type 'CrystalDecisions.ReportAppServer.ReportDefModel.EditableRTFExportFormatOptionsClass' from assembly 'CrystalDecisions.ReportAppServer.ReportDefModel, Version=11.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304'...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8337
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8748
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2754
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1978
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.