|
hi,
I am using vb.net 2005 with the report viewer control and the built-in
reports (NOT CRYSTAL REPORTS). The report viewer fills a regular form,
which when opened grabs the data for the report (based on certain parameters)
The reports themselves are RDLC files.
following code properly display the preview of my report
Private Sub ShowReport(ByVal Id As Long)<br />
Dim mdIns As New mdGlobal<br />
Dim str As String<br />
Dim AwiCashFlowDataSet As New DataSet<br />
str = "SELECT * FROM Analysis where c_id=" & Id<br />
CashFlowDataSet = mdIns.GetResultFromQuery(str) 'retun dataset with data<br />
CashFlowDataSet.Tables(0).TableName = "ReturnOnCash"<br />
<br />
Dim RDS As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource<br />
ReturnOnCashBindingSource.DataSource = CashFlowDataSet<br />
ReturnOnCashBindingSource.DataMember = "ReturnOnCash"<br />
RDS.Name = "CashFlowDataSet_ReturnOnCash"<br />
RDS.Value = ReturnOnCashBindingSource<br />
Me.ReportViewer1.LocalReport.DataSources.Add(RDS)<br />
If mdChecking.ReportNumber = 1 Then<br />
ReportViewer1.LocalReport.ReportEmbeddedResource = "Analysis.rptReturnOnCash.rdlc"<br />
Else<br />
ReportViewer1.LocalReport.ReportEmbeddedResource = "Analysis.rptCashFlow.rdlc"<br />
End If<br />
<br />
Me.ReportViewer1.RefreshReport()<br />
If IsPrint = False Then<br />
Me.Show()<br />
Else<br />
IsPrint = False<br />
End If<br />
<br />
End Sub
now i want to print the report without preview but i can't. because i dont know
anybody have idea that how can i print the report without preview using reportviewer
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
You know what would be really cool? Posting this in the Visual Basic/VB.NET forum instead.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
|
Dave and I are going to have to disagree on this one. While he's right that Reporting Services are part of SQL Server, what you are trying to do has absolutely nothing to do with SQL. There's no query to fix, no database server connection to sort out.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
His original question was only on Reporting Services. Now he's gone and jumped back into the VB.NET relm.
|
|
|
|
|
How to pass NULL for the Image Datatype in SQL Server. For example we pass Null to int, string etc. Please tell me how is this possible for Image.
|
|
|
|
|
You can try using the System.DBNull class. It has a property Value which represents a NULL value in the database. It would be like that:
myDBVariable = DBNull.Value;
Talal
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
In a stored procedure I inserted the datas thro' parameters. In the parameter I have to insert the column name; I need to change the column name dynamically for each time in insert the value in the parameter so that I can sort various columns. I tried to use the below method but couldn't. Can anyone help me out.
create proc sortTable @column varchar(10),@direction varchar(5) as
declare @type varchar(5)
set @type = @direction
if @type = 'asc'
select * from tblname order by @column asc
else
select * from tblname order by @column desc
Regards,
LEE
|
|
|
|
|
You would need to turn your select statement into a string and then execute it, e.g.
declare @sql nvarchar(400)
set @sql = 'select * from tblname order by ' + @column + ' ' + @type
exec (@sql) I really don't like doing this, but if it's what you need to do...
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Im agree with Pete.
If the table dont have many columns you can make a SqL BY any Column whith different sort. But this no mantenible for futures develops.
I have to work with a lot dynamic sentences, i suggest dont use "*" and before you put this sentence into a procedure run execute plan to watch the behavior
|
|
|
|
|
Hi,
After my SELECT I have the following results (partially here):
ID Name ParentID
256 Language, Literature And Biography 2878
257 Language & Linguistics 256
258 Philosophy Of Language 257
261 Language Acquisition 260
267 Language Family Studies 263
289 Language Usage Guides 284
292 Language Teaching & Learning (other Than ELT) 256
293 Language Teaching Theory & Methods 292
294 Language Teaching & Learning Material & Coursework 292
(please excuse if this is not properly aligned)
I thought about using the dataset's Relations property, like:
ds.Relations.Add("NodeRelation", ds.Tables(0).Columns("ID"), ds.Tables(0).Columns("ParentID"))
..but I get errors if there is no link between and ID and ParentID. How else can I do this??
Please help.
Regards
ma se
|
|
|
|
|
Please explain. What exactly are you trying to do and what is not working? What is your select statement? We need more information to help you.
|
|
|
|
|
Hi,
I am developing an application using Visual studio 2005 and sqlEXPRESS 2005(both are installed in my machine). My problem is i can connect to sqlexpress via visual studio. I think it does not accept my connection string which is:
"Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword";
for myServerAddress if i wrote localhost\SQLEXPRESS C# doest not like the '\'.
If someone i have an idea ?
Thank you
|
|
|
|
|
try localhost\\SQLEXPRESS
I Love SQL
|
|
|
|
|
|
hi all
how many max connection to a database in sqlserver ??
|
|
|
|
|
Please make question more sensitive.
And try to make a google[^]search
I Love SQL
|
|
|
|
|
Hello,
32767 concurrent connections are allowed in SQL 2000.
Senthil S
Software Engineer
|
|
|
|
|
How can i show a crystlreport in vb program
|
|
|
|
|
You couldn't have picked a more inappropriate forum could you? I doubt there are many people here who have active VB6 skills.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: I doubt there are many people here who have active VB6 skills.
Some of us have to still maintain legacy code for clients who won't (or can't) upgrade...
|
|
|
|
|
But, out of the 4,382,390 members, how many are going to admit to having VB skills and how many actually look at the forums.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: how many are going to admit to having VB skills
Why not?? anybody can do VB...
|
|
|
|
|
Go on - post this as a survey question, and see how many admit to currently coding in VB/
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: Go on - post this as a survey question, and see how many admit to currently coding in VB/
I did not say people would admit to doing it, I just said anybody _could_
|
|
|
|