473,385 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Crystal Reports Recordselection formula not working while exportin

Hi,

Record selection Formaula is not working while exporting the report to Excel
There is absolutely no problem while using a crystal report viewer but if i
export it to a excel the selection formula dosen't seems to have any effect .
For the Report I am using a Stored procedure . Selection Formula is working
Fine
wile I am using a Crystal report viewer .
rpt1.SetParameterValue(0, line.Value)
rpt1.SetParameterValue(1, agents.Value)

Dim name, cntype As String
name = "IR-" & agents.Value & "-" & strblno & ".xls"
cntype = "Application/x-msexcel"
Dim str As Stream

Dim rExpOpts As New ExportOptions
rExpOpts.ExportFormatType = ExportFormatType.Excel
rExpOpts.FormatOptions = New ExcelFormatOptions

If strquery <> "" Then
rpt1.RecordSelectionFormula = strquery
End If

Dim rExpReqContext As New ExportRequestContext
rExpReqContext.ExportInfo = rExpOpts
str = rpt1.FormatEngine.ExportToStream(rExpReqContext)
Dim bArray As Byte()
ReDim bArray(str.Length)
str.Read(bArray, 0, str.Length)
Response.ClearContent()
Response.ClearHeaders()
Response.Expires = -1
Response.AppendHeader("content-disposition", "attachment;
filename=" + name)
Response.AppendHeader("Cache-Control", "no-cache")
Response.AppendHeader("Pragma", "no-cache")
Response.ContentType = cntype
Response.BinaryWrite(bArray)
Response.Flush()
Response.Close()
sri_007
Nov 19 '05 #1
0 2818

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

Similar topics

1
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal...
0
by: Matt Fuerst | last post by:
Greetings all, I'm having an issue with my Web application. It's deployed using Crystal Reports 8.0 Developer edition. I have an RPT file with a relatively large number of formulas (30+). I...
0
by: Tim Jones | last post by:
Hey all, I am trying to try get a crytal report running properly. A "Hello World" report that does not add criteria to the record selection formula of the report (either in the development tool,...
1
by: Jude_44 | last post by:
Hi I have a Crystal Report that I need to base on a set of 4 tables, as listed and described below: Companies Projects TimeEntries ProjectExpenses Basically, is for Timekeeping...
5
by: Georgess | last post by:
Hi I have a problem with a crystal reports viewer I have developed with VS.Net 2003. Everything was working fine until I tried to view reports with suppression formulas... Eg. suppress (no Drill...
3
by: Brad | last post by:
This is the next step of a bigger project that I am working on and I have hit a wall. All forms that I have created for this project are working fine. This is the one that I have a problem...
1
by: amit | last post by:
Hi guys I am using access database with Crystal Reports in VS2003 I am working on "Hospital Database" The fields are - Name - Date - ConsultingCharge - TotalFees i.e. Total Fees include fees...
3
by: Tmuld | last post by:
Hello, I was provided a .rpt file which is Crystal Reports report. It opened with VS .NET 2003. On the left side in the Field Explorer - there are seveal categories - Database Fields -...
6
by: G. Stoynev | last post by:
I can't seem to be able to prevent a Crystal Reports formula to evaluate an expression when the report contains no records to show. Here's the formula (DateTransferred is a DateTime column): ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.