Showing posts with label button. Show all posts
Showing posts with label button. Show all posts

Monday, March 26, 2012

Parameter Change and Report Clears

When I change the value of a parameter the report is cleared on a post back to the server and I have to click on the View Report button to see any results. Is there a way to either not post back to the server when the parameter is changed or automatically post back and retrieve the new results?

I found this link below here and it sounds like I am out of luck since both of my parameters are dates with functions to define them. I have tried changing their order with no luck.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=284284&SiteID=1

Does anyone know if this is an issue without a work around?

Thanks!

Looks like I am out of luck.

Monday, March 12, 2012

Paging large Results in SQL 2005

lets say we have more than 100 000 rows in Table1, and we want to view each 10 rows alone... and by pressing on a NEXT button we will see the other 10 pages...

there is 2 buttons : NEXT and PREVIOUS

so can anyone tell me how to do that in SQL 2005, and what is correctly called.

I have found a code that does use ROW_NUMBER in order to view results between 2 numbers,

example: rows between 10 and 50...
but It is not what I want, so please I need some help, thank you

By Uncle SamIf you code this by program, you can use ADO object that contains "PageSize" property to set how many records could be shown in a page.|||you can do some trick with the NTILE function to get the result. though it wont perform good. also with NTILE function you need back calculate the number of pages if 10 rows per page is to be displayed....

select * from (select *,ntile(2) over(order by COL1) as PgNo from test) as TempTbl where TempTbl.PgNo = 2|||Ok can you tell me how to do that, because I am beginner|||+1 : bad idea to solve this issue using cursor or any other server-side trick. You must manage that in your client-side...|||ok but is there any Stored procedure that does it|||Order your result set by a primary (natural) key. Write your NEXT procedure to take a starting key and a requested record count and return that number of records starting at that point in the result set. Your application just needs to know that last pkey it received in order to request the next page. Similar logic works for PREVIOUS recordsets.|||okay but please can you write for me the code, because I am still a beginner and this is my project. Thank you so much|||Are you doing your project for free? Because I generally charge something for my services...

I encourage you to either hire a dba to help you, or learn advanced SQL real fast.|||sorry but I can't afford paying an advice|||You're not asking for advice. You are asking for somebody to do the work for you.

Paging large Results in SQL 2005

lets say we have more than 100 000 rows in Table1, and we want to view each 10 rows alone.... and by pressing on a NEXT button we will see the other 10 pages....

there is 2 buttons : NEXT and PREVIOUS

so can anyone tell me how to do that in SQL 2005, and what is correctly called.

I have found a code that does use ROW_NUMBER in order to view results between 2 numbers,

example: rows between 10 and 50....
but It is not what I want, so please I need some help, thank you

By Uncle Sam

You can use the ROW_NUMBER approach to page through results. You need to vary the row number ranges depending on the page. The other approach is to use TOP logic. Please take a look at the link below for the various techniques.

http://www.aspfaq.com/show.asp?id=2120

|||

Well I've been through that problem.. not only 100 000 rows but more than 1 000 000 records with multiple table lookup.. I've try every methods available on web and I found out the solution by combining all ideas.. You can look at my blog in this link and if you have any questions just email me..

http://weblogs.sqlteam.com/randyp/archive/2005/06/23/6335.aspx

|||okay but is there any creation for a button NEXT that jumps to the next page of the results.

Friday, March 9, 2012

Paging and printing without the toolbar

Is there a way to issue the report print command or paging command from code.
I would like to hide the toolbar and use another button in our ASP.NET
application to kick off printing or tell the reportviewer to go to another
page.
ThanksPerhaps you could use the findstring to search for the literal in a report
ie
http://server/Reportserver?/SampleReports/Product
Catalog&rs:Command=Render&rc:StartFind=1&rc:EndFind=5&rc:FindString=Mountain-400
Search for URL Access in Books on line and you will get all of the URL
parameters, etc... There is also code which shows you how to put and IE
browswer instance in a windows form, and put a report into it...
--
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
I support the Professional Association for SQL Server ( PASS) and it''s
community of SQL Professionals.
"NeedToKnow" wrote:
> Is there a way to issue the report print command or paging command from code.
> I would like to hide the toolbar and use another button in our ASP.NET
> application to kick off printing or tell the reportviewer to go to another
> page.
> Thanks|||I do not understand. I have looked through URL Access and why would I want to
find a literal. I want to send the command to reportviewer through a URL
that tells the report viewer to print the current report to the printer.
"Wayne Snyder" wrote:
> Perhaps you could use the findstring to search for the literal in a report
> ie
> http://server/Reportserver?/SampleReports/Product
> Catalog&rs:Command=Render&rc:StartFind=1&rc:EndFind=5&rc:FindString=Mountain-400
>
> Search for URL Access in Books on line and you will get all of the URL
> parameters, etc... There is also code which shows you how to put and IE
> browswer instance in a windows form, and put a report into it...
> --
> Wayne Snyder MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> I support the Professional Association for SQL Server ( PASS) and it''s
> community of SQL Professionals.
>
> "NeedToKnow" wrote:
> > Is there a way to issue the report print command or paging command from code.
> > I would like to hide the toolbar and use another button in our ASP.NET
> > application to kick off printing or tell the reportviewer to go to another
> > page.
> >
> > Thanks|||You asked two question. He answered one of them (the one about going to
another page).
As far as printing, I don't think what you want is possible with the report
viewer control. Are you using the one from VS 2005?
I wanted to do something similar with the winform report viewer control but
found out that until it is rendered I can't request for it to print. So for
Windows I am setting a property to print and then responding to the
rendering event and if their is a request to print, I print and then close
the form. However, I am not familiar with the webform control from VS 2005.
If you are doing this in RS 2000 then I have even less to offer as a
suggestion.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"NeedToKnow" <NeedToKnow@.newsgroups.nospam> wrote in message
news:ECC2AC4D-1252-4A19-A22D-B284920EC5FC@.microsoft.com...
>I do not understand. I have looked through URL Access and why would I want
>to
> find a literal. I want to send the command to reportviewer through a URL
> that tells the report viewer to print the current report to the printer.
> "Wayne Snyder" wrote:
>> Perhaps you could use the findstring to search for the literal in a
>> report
>> ie
>> http://server/Reportserver?/SampleReports/Product
>> Catalog&rs:Command=Render&rc:StartFind=1&rc:EndFind=5&rc:FindString=Mountain-400
>>
>> Search for URL Access in Books on line and you will get all of the URL
>> parameters, etc... There is also code which shows you how to put and IE
>> browswer instance in a windows form, and put a report into it...
>> --
>> Wayne Snyder MCDBA, SQL Server MVP
>> Mariner, Charlotte, NC
>> I support the Professional Association for SQL Server ( PASS) and it''s
>> community of SQL Professionals.
>>
>> "NeedToKnow" wrote:
>> > Is there a way to issue the report print command or paging command from
>> > code.
>> > I would like to hide the toolbar and use another button in our ASP.NET
>> > application to kick off printing or tell the reportviewer to go to
>> > another
>> > page.
>> >
>> > Thanks|||It is vs 2005.
I don't want to print the form, since my report is several pages long. Is
there a way to do this?
"Bruce L-C [MVP]" wrote:
> You asked two question. He answered one of them (the one about going to
> another page).
> As far as printing, I don't think what you want is possible with the report
> viewer control. Are you using the one from VS 2005?
> I wanted to do something similar with the winform report viewer control but
> found out that until it is rendered I can't request for it to print. So for
> Windows I am setting a property to print and then responding to the
> rendering event and if their is a request to print, I print and then close
> the form. However, I am not familiar with the webform control from VS 2005.
> If you are doing this in RS 2000 then I have even less to offer as a
> suggestion.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "NeedToKnow" <NeedToKnow@.newsgroups.nospam> wrote in message
> news:ECC2AC4D-1252-4A19-A22D-B284920EC5FC@.microsoft.com...
> >I do not understand. I have looked through URL Access and why would I want
> >to
> > find a literal. I want to send the command to reportviewer through a URL
> > that tells the report viewer to print the current report to the printer.
> >
> > "Wayne Snyder" wrote:
> >
> >> Perhaps you could use the findstring to search for the literal in a
> >> report
> >>
> >> ie
> >> http://server/Reportserver?/SampleReports/Product
> >> Catalog&rs:Command=Render&rc:StartFind=1&rc:EndFind=5&rc:FindString=Mountain-400
> >>
> >>
> >> Search for URL Access in Books on line and you will get all of the URL
> >> parameters, etc... There is also code which shows you how to put and IE
> >> browswer instance in a windows form, and put a report into it...
> >> --
> >> Wayne Snyder MCDBA, SQL Server MVP
> >> Mariner, Charlotte, NC
> >>
> >> I support the Professional Association for SQL Server ( PASS) and it''s
> >> community of SQL Professionals.
> >>
> >>
> >> "NeedToKnow" wrote:
> >>
> >> > Is there a way to issue the report print command or paging command from
> >> > code.
> >> > I would like to hide the toolbar and use another button in our ASP.NET
> >> > application to kick off printing or tell the reportviewer to go to
> >> > another
> >> > page.
> >> >
> >> > Thanks
>
>

Wednesday, March 7, 2012

Paginate VB options

I have a VB.NET 2005 program that on a click of a button exports my report to a text file. This works fine apart from one thing, i get a strange charactor every 60 lines. So i opened Crystal Deveolper and tried exporting from there and it gave me and option set number of lines per page and setting this to 0 switched off paginate, which removed the charactors.

My question is this how do i add the options for Charactors/Inch and Number of Lines per Page (setting this to 0 switches off paginate). Here is my code so far:-

Private Sub btnGenFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGenFile.Click Dim

Exportpath As String Exportpath = "n:\Regatta Order Files\"
CrDiskfileDestinationoption = New DiskFileDestinationOptions
CrExportOption = CrReport.ExportOptions
CrDiskfileDestinationoption.DiskFileName = Exportpath + ("CHAN1" & sDate & ".txt")
With CrExportOption
.DestinationOptions = CrDiskfileDestinationoption
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.Text
End With

Try CrReport.Export()
'MessageBox.Show("Exported to " & CrReport.ExportOptions.DestinationOptions.DiskFileName)
txtStatus.Text = "Text File has been created, you can now tranfer to Regatta"
Catch ex As Exception
MessageBox.Show(Me, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try

End Sub

I have XP Pro SP2
Visual Studio 2005
Crystal Reports Developer XI R2dump

Monday, February 20, 2012

Page Setup button in Report Viewer object

I have develop a Windows Form Application that have a Report Viewer object
that rendering a report .rdlc.
I have a problem with the PageSetup Button. The button for set the layout of
the page. If I click that button the type of the page is on Letter format and
i must always set the margin on A4 format of the page before print the
report. But that appends in someone PC...unfortunately it appends on the PC
of the client (in the driver of the printer the page layout is set to A4).
How I can resolve that problem?
Another problem is the set of the margin in PageSetup Button.
If I click on 'Page setup' button the margins left & right are not what I
set on the rdlc file at design time (0,5cm) they are 2 mm
If I click OK on the 'Page Setup' form the Report margins change to the
margins from 'Page setup'
If I open ''Page setup' again the margin settings are now less than
previously set and clicking OK results in the report margins changing again
The margin change from 2 to 0,8 -> from 0,8 to 0,3 -> from 0,3 to 0,1 ->
from 0,1 to 0.
I have Visual Studio 2005 service pack 1Are you doing the 'ChangeService' voodoo that needs to be done to save the
report?
Check 'www.gotreportviewer.com' for an example at what you are doing.
I am no expert at SSRS myself.. just started my fight with it last week so...
- Tanmay
"Marco82bg" wrote:
> I have develop a Windows Form Application that have a Report Viewer object
> that rendering a report .rdlc.
> I have a problem with the PageSetup Button. The button for set the layout of
> the page. If I click that button the type of the page is on Letter format and
> i must always set the margin on A4 format of the page before print the
> report. But that appends in someone PC...unfortunately it appends on the PC
> of the client (in the driver of the printer the page layout is set to A4).
> How I can resolve that problem?
> Another problem is the set of the margin in PageSetup Button.
> If I click on 'Page setup' button the margins left & right are not what I
> set on the rdlc file at design time (0,5cm) they are 2 mm
> If I click OK on the 'Page Setup' form the Report margins change to the
> margins from 'Page setup'
> If I open ''Page setup' again the margin settings are now less than
> previously set and clicking OK results in the report margins changing again
> The margin change from 2 to 0,8 -> from 0,8 to 0,3 -> from 0,3 to 0,1 ->
> from 0,1 to 0.
> I have Visual Studio 2005 service pack 1