Showing posts with label print. Show all posts
Showing posts with label print. Show all posts

Monday, March 26, 2012

Forcing section break to odd pages

Hi - I'm new to this forum and fairly new to Crystal. Using 9.0. Because we print two-sided, I need to force a section break to start on next available odd numbered page so that I can treat the printed sections as separate documents (e.g. I don't want 1st page of new section to print on back of preceeding section). These sections are anywhere from 10 - 18 pages in length, and it is a huge report - over 11,000 pages. I'm pretty sure that there is a way to do this but I don't have time to fumble around with it. I already have 10 hours in this one report!

Thanks in advance
RobinI wrote a report recently that needed something simular, prehaps you can try this. The report prints a list of people at a specific place. Sometimes the place (group one) has lots of people and stems onto two pages and other times it fits on one page. As I'm duplex printing, I need to check whether the pages are even or odd and thus to include a page break or not.

In the section expect, I added a new group footer. In both group footer 1a and 1b I checked the 'new page after'. Then in group footer 1b, I added

Right (ToText(PageNumber),1) in ["0","2","4","6","8"]

which causes my report only to add a blank page after group one has finished if the current page number ends in any of the values above.

Hope it helps.

Forcing page breaks

Hello,
Apologies if this is a silly question. I am using Reporting services with
ODBC to convert print image text files into pdb files. Each record/line of
the file has one character code then the data for the line of the report. I
used odbc to describe the file to have 2 columns. The columns are ID and
Data.
Now for the question: I need to force a page break whenever the contents of
the ID column are a '1'. THis sounds like it should be really easy, but I
cannot seem to figure out how to do this.
ThanksI have an example on www.msbicentral.com which allows you to do a page break
after X number of lines. The example (if I remember correctly) uses an
expression for the page break. You could simply change the expression.
Search for Page or Page Break in the Downloads->Reporting Services ->RDL
section
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Stan" <Stan@.discussions.microsoft.com> wrote in message
news:DB2E845D-875B-4770-8C3E-4D0E06ACCFBE@.microsoft.com...
> Hello,
> Apologies if this is a silly question. I am using Reporting services with
> ODBC to convert print image text files into pdb files. Each record/line
> of
> the file has one character code then the data for the line of the report.
> I
> used odbc to describe the file to have 2 columns. The columns are ID and
> Data.
> Now for the question: I need to force a page break whenever the contents
> of
> the ID column are a '1'. THis sounds like it should be really easy, but I
> cannot seem to figure out how to do this.
> Thanks|||Wayne,
Thanks for the tip. Unfortunately, I cannot seem to get it to work. My
data is tabular and not a matrix (tho I have tried both). When ever I add
any group the order of the data gets all fubar(ed) and I cannot seem to stop
it from doing this. The darn reports takes all the ID=1 rows(which is the
first line of each page) and puts them all at the top of the report.
Any more help you can off would be appreciated, but as always the search
continues.
Thanks
Stan
"Wayne Snyder" wrote:
> I have an example on www.msbicentral.com which allows you to do a page break
> after X number of lines. The example (if I remember correctly) uses an
> expression for the page break. You could simply change the expression.
> Search for Page or Page Break in the Downloads->Reporting Services ->RDL
> section
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Stan" <Stan@.discussions.microsoft.com> wrote in message
> news:DB2E845D-875B-4770-8C3E-4D0E06ACCFBE@.microsoft.com...
> > Hello,
> >
> > Apologies if this is a silly question. I am using Reporting services with
> > ODBC to convert print image text files into pdb files. Each record/line
> > of
> > the file has one character code then the data for the line of the report.
> > I
> > used odbc to describe the file to have 2 columns. The columns are ID and
> > Data.
> >
> > Now for the question: I need to force a page break whenever the contents
> > of
> > the ID column are a '1'. THis sounds like it should be really easy, but I
> > cannot seem to figure out how to do this.
> >
> > Thanks
>
>|||I would love to hear a better answer, but if there isn't any other way...
How about using a custom function that acts as a counter that incremented
every time there was a 1? So the data would look something like:
counter ID Data
0 | 0 | xyz
0 | 0 | xyz
0 | 0 | xyz
1 | 1 | xyz
1 | 0 | xyz
1 | 0 | xyz
2 | 1 | xyz
2 | 0 | xyz
2 | 0 | xyz
etc.
Then, you could group by that function and put page breaks after each group.
A simple function could look something like:
Private x As Integer
Public Function addone(ByVal num As Integer) As Integer
x = x + num
Return x
End Function
The function doesn't actually need to be on the report, just use it to
group. Insert a group and for the expression:
=code.addone(Fields!id.value)
Mike G.
"Stan" <Stan@.discussions.microsoft.com> wrote in message
news:191002EE-50DD-4FEA-80DC-70A5D3A95DB4@.microsoft.com...
> Wayne,
> Thanks for the tip. Unfortunately, I cannot seem to get it to work. My
> data is tabular and not a matrix (tho I have tried both). When ever I add
> any group the order of the data gets all fubar(ed) and I cannot seem to
> stop
> it from doing this. The darn reports takes all the ID=1 rows(which is the
> first line of each page) and puts them all at the top of the report.
> Any more help you can off would be appreciated, but as always the search
> continues.
> Thanks
> Stan
>
> "Wayne Snyder" wrote:
>> I have an example on www.msbicentral.com which allows you to do a page
>> break
>> after X number of lines. The example (if I remember correctly) uses an
>> expression for the page break. You could simply change the expression.
>> Search for Page or Page Break in the Downloads->Reporting Services ->RDL
>> section
>> --
>> Wayne Snyder, MCDBA, SQL Server MVP
>> Mariner, Charlotte, NC
>> www.mariner-usa.com
>> (Please respond only to the newsgroups.)
>> I support the Professional Association of SQL Server (PASS) and it's
>> community of SQL Server professionals.
>> www.sqlpass.org
>> "Stan" <Stan@.discussions.microsoft.com> wrote in message
>> news:DB2E845D-875B-4770-8C3E-4D0E06ACCFBE@.microsoft.com...
>> > Hello,
>> >
>> > Apologies if this is a silly question. I am using Reporting services
>> > with
>> > ODBC to convert print image text files into pdb files. Each
>> > record/line
>> > of
>> > the file has one character code then the data for the line of the
>> > report.
>> > I
>> > used odbc to describe the file to have 2 columns. The columns are ID
>> > and
>> > Data.
>> >
>> > Now for the question: I need to force a page break whenever the
>> > contents
>> > of
>> > the ID column are a '1'. THis sounds like it should be really easy,
>> > but I
>> > cannot seem to figure out how to do this.
>> >
>> > Thanks
>>|||Mike,
I was on this track, but could not get it right. You hit the nail right on
the head.
Thanks!!!
Stan
"Mike G." wrote:
> I would love to hear a better answer, but if there isn't any other way...
> How about using a custom function that acts as a counter that incremented
> every time there was a 1? So the data would look something like:
> counter ID Data
> 0 | 0 | xyz
> 0 | 0 | xyz
> 0 | 0 | xyz
> 1 | 1 | xyz
> 1 | 0 | xyz
> 1 | 0 | xyz
> 2 | 1 | xyz
> 2 | 0 | xyz
> 2 | 0 | xyz
> etc.
> Then, you could group by that function and put page breaks after each group.
> A simple function could look something like:
> Private x As Integer
> Public Function addone(ByVal num As Integer) As Integer
> x = x + num
> Return x
> End Function
> The function doesn't actually need to be on the report, just use it to
> group. Insert a group and for the expression:
> =code.addone(Fields!id.value)
> Mike G.
> "Stan" <Stan@.discussions.microsoft.com> wrote in message
> news:191002EE-50DD-4FEA-80DC-70A5D3A95DB4@.microsoft.com...
> > Wayne,
> >
> > Thanks for the tip. Unfortunately, I cannot seem to get it to work. My
> > data is tabular and not a matrix (tho I have tried both). When ever I add
> > any group the order of the data gets all fubar(ed) and I cannot seem to
> > stop
> > it from doing this. The darn reports takes all the ID=1 rows(which is the
> > first line of each page) and puts them all at the top of the report.
> >
> > Any more help you can off would be appreciated, but as always the search
> > continues.
> >
> > Thanks
> >
> > Stan
> >
> >
> >
> > "Wayne Snyder" wrote:
> >
> >> I have an example on www.msbicentral.com which allows you to do a page
> >> break
> >> after X number of lines. The example (if I remember correctly) uses an
> >> expression for the page break. You could simply change the expression.
> >>
> >> Search for Page or Page Break in the Downloads->Reporting Services ->RDL
> >> section
> >>
> >> --
> >> Wayne Snyder, MCDBA, SQL Server MVP
> >> Mariner, Charlotte, NC
> >> www.mariner-usa.com
> >> (Please respond only to the newsgroups.)
> >>
> >> I support the Professional Association of SQL Server (PASS) and it's
> >> community of SQL Server professionals.
> >> www.sqlpass.org
> >>
> >> "Stan" <Stan@.discussions.microsoft.com> wrote in message
> >> news:DB2E845D-875B-4770-8C3E-4D0E06ACCFBE@.microsoft.com...
> >> > Hello,
> >> >
> >> > Apologies if this is a silly question. I am using Reporting services
> >> > with
> >> > ODBC to convert print image text files into pdb files. Each
> >> > record/line
> >> > of
> >> > the file has one character code then the data for the line of the
> >> > report.
> >> > I
> >> > used odbc to describe the file to have 2 columns. The columns are ID
> >> > and
> >> > Data.
> >> >
> >> > Now for the question: I need to force a page break whenever the
> >> > contents
> >> > of
> >> > the ID column are a '1'. THis sounds like it should be really easy,
> >> > but I
> >> > cannot seem to figure out how to do this.
> >> >
> >> > Thanks
> >>
> >>
> >>
>
>

Forcing display of QA's buffer

How can I force the contents of Query Analyzer's buffer to display to the
screen?
A stored proc has some debug PRINT statements in it. The proc takes a long
time to execute and the PRINT statements don't display until execution is
complete.
Is it possible to force them to display immediately? If so, how?How about RAISERROR WITH NOWAIT? Watch the messages pane:
PRINT 'foo'
WAITFOR DELAY '00:00:05'
GO
RAISERROR('foo', 11, 1) WITH NOWAIT
WAITFOR DELAY '00:00:05'
GO
http://www.aspfaq.com/
(Reverse address to reply.)
"Dave" <dave@.nospam.ru> wrote in message
news:uyWPdkbHFHA.2784@.TK2MSFTNGP09.phx.gbl...
> How can I force the contents of Query Analyzer's buffer to display to the
> screen?
> A stored proc has some debug PRINT statements in it. The proc takes a
long
> time to execute and the PRINT statements don't display until execution is
> complete.
> Is it possible to force them to display immediately? If so, how?
>|||Thanks Aaron
That works and it also prints out any unprinted PRINT statements previous to
the RAISERROR.
THe red error messages are a distraction but I can live with that.
Thank you.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:uVVzjnbHFHA.4048@.TK2MSFTNGP15.phx.gbl...
> How about RAISERROR WITH NOWAIT? Watch the messages pane:
>
> PRINT 'foo'
> WAITFOR DELAY '00:00:05'
> GO
> RAISERROR('foo', 11, 1) WITH NOWAIT
> WAITFOR DELAY '00:00:05'
> GO
>
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Dave" <dave@.nospam.ru> wrote in message
> news:uyWPdkbHFHA.2784@.TK2MSFTNGP09.phx.gbl...
> > How can I force the contents of Query Analyzer's buffer to display to
the
> > screen?
> >
> > A stored proc has some debug PRINT statements in it. The proc takes a
> long
> > time to execute and the PRINT statements don't display until execution
is
> > complete.
> >
> > Is it possible to force them to display immediately? If so, how?
> >
> >
>|||Even better, use a severity of 10 or lower to emulate what PRINT does (i.e.,
no error condition raised)...
--
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:uVVzjnbHFHA.4048@.TK2MSFTNGP15.phx.gbl...
> How about RAISERROR WITH NOWAIT? Watch the messages pane:
>
> PRINT 'foo'
> WAITFOR DELAY '00:00:05'
> GO
> RAISERROR('foo', 11, 1) WITH NOWAIT
> WAITFOR DELAY '00:00:05'
> GO
>
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Dave" <dave@.nospam.ru> wrote in message
> news:uyWPdkbHFHA.2784@.TK2MSFTNGP09.phx.gbl...
> > How can I force the contents of Query Analyzer's buffer to display to
the
> > screen?
> >
> > A stored proc has some debug PRINT statements in it. The proc takes a
> long
> > time to execute and the PRINT statements don't display until execution
is
> > complete.
> >
> > Is it possible to force them to display immediately? If so, how?
> >
> >
>|||Good point, just in the habit of using 11.
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:egrs6xbHFHA.720@.TK2MSFTNGP10.phx.gbl...
> Even better, use a severity of 10 or lower to emulate what PRINT does
(i.e.,
> no error condition raised)...
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:uVVzjnbHFHA.4048@.TK2MSFTNGP15.phx.gbl...
> > How about RAISERROR WITH NOWAIT? Watch the messages pane:
> >
> >
> > PRINT 'foo'
> > WAITFOR DELAY '00:00:05'
> > GO
> > RAISERROR('foo', 11, 1) WITH NOWAIT
> > WAITFOR DELAY '00:00:05'
> > GO
> >
> >
> > --
> > http://www.aspfaq.com/
> > (Reverse address to reply.)
> >
> >
> >
> >
> > "Dave" <dave@.nospam.ru> wrote in message
> > news:uyWPdkbHFHA.2784@.TK2MSFTNGP09.phx.gbl...
> > > How can I force the contents of Query Analyzer's buffer to display to
> the
> > > screen?
> > >
> > > A stored proc has some debug PRINT statements in it. The proc takes a
> > long
> > > time to execute and the PRINT statements don't display until execution
> is
> > > complete.
> > >
> > > Is it possible to force them to display immediately? If so, how?
> > >
> > >
> >
> >
>|||> THe red error messages are a distraction but I can live with that.
Just follow Adam's advice and lower the severity level.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Dave" <dave@.nospam.ru> wrote in message news:emHu5xbHFHA.3780@.TK2MSFTNGP10.phx.gbl...
> Thanks Aaron
> That works and it also prints out any unprinted PRINT statements previous to
> the RAISERROR.
> THe red error messages are a distraction but I can live with that.
> Thank you.
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:uVVzjnbHFHA.4048@.TK2MSFTNGP15.phx.gbl...
>> How about RAISERROR WITH NOWAIT? Watch the messages pane:
>>
>> PRINT 'foo'
>> WAITFOR DELAY '00:00:05'
>> GO
>> RAISERROR('foo', 11, 1) WITH NOWAIT
>> WAITFOR DELAY '00:00:05'
>> GO
>>
>> --
>> http://www.aspfaq.com/
>> (Reverse address to reply.)
>>
>>
>> "Dave" <dave@.nospam.ru> wrote in message
>> news:uyWPdkbHFHA.2784@.TK2MSFTNGP09.phx.gbl...
>> > How can I force the contents of Query Analyzer's buffer to display to
> the
>> > screen?
>> >
>> > A stored proc has some debug PRINT statements in it. The proc takes a
>> long
>> > time to execute and the PRINT statements don't display until execution
> is
>> > complete.
>> >
>> > Is it possible to force them to display immediately? If so, how?
>> >
>> >
>>
>|||Got it.
Thanks
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uj4f94bHFHA.3624@.tk2msftngp13.phx.gbl...
> > THe red error messages are a distraction but I can live with that.
> Just follow Adam's advice and lower the severity level.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> http://www.sqlug.se/
>
> "Dave" <dave@.nospam.ru> wrote in message
news:emHu5xbHFHA.3780@.TK2MSFTNGP10.phx.gbl...
> > Thanks Aaron
> >
> > That works and it also prints out any unprinted PRINT statements
previous to
> > the RAISERROR.
> >
> > THe red error messages are a distraction but I can live with that.
> >
> > Thank you.
> >
> >
> > "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> > news:uVVzjnbHFHA.4048@.TK2MSFTNGP15.phx.gbl...
> >> How about RAISERROR WITH NOWAIT? Watch the messages pane:
> >>
> >>
> >> PRINT 'foo'
> >> WAITFOR DELAY '00:00:05'
> >> GO
> >> RAISERROR('foo', 11, 1) WITH NOWAIT
> >> WAITFOR DELAY '00:00:05'
> >> GO
> >>
> >>
> >> --
> >> http://www.aspfaq.com/
> >> (Reverse address to reply.)
> >>
> >>
> >>
> >>
> >> "Dave" <dave@.nospam.ru> wrote in message
> >> news:uyWPdkbHFHA.2784@.TK2MSFTNGP09.phx.gbl...
> >> > How can I force the contents of Query Analyzer's buffer to display to
> > the
> >> > screen?
> >> >
> >> > A stored proc has some debug PRINT statements in it. The proc takes
a
> >> long
> >> > time to execute and the PRINT statements don't display until
execution
> > is
> >> > complete.
> >> >
> >> > Is it possible to force them to display immediately? If so, how?
> >> >
> >> >
> >>
> >>
> >
> >
>|||did you try using "results in text" instead of "results in grid"?
Dave wrote:
> How can I force the contents of Query Analyzer's buffer to display to the
> screen?
> A stored proc has some debug PRINT statements in it. The proc takes a long
> time to execute and the PRINT statements don't display until execution is
> complete.
> Is it possible to force them to display immediately? If so, how?|||SQL Server doesn't send its output to the client immediately as it is generated by the engine. This
is to consume less network resources. And this is the reason why we don't see things like PRINT
immediately after they have been performed. SQL Server will wait until its output buffer is full, or
until the batch has ended. The trick with RAISERROR and NOWAIT is that it forces SQL Server to flush
the output buffer.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"ch" <ch@.dontemailme.com> wrote in message news:42237E8F.7DC18B52@.dontemailme.com...
> did you try using "results in text" instead of "results in grid"?
>
> Dave wrote:
>> How can I force the contents of Query Analyzer's buffer to display to the
>> screen?
>> A stored proc has some debug PRINT statements in it. The proc takes a long
>> time to execute and the PRINT statements don't display until execution is
>> complete.
>> Is it possible to force them to display immediately? If so, how?|||> The trick with RAISERROR and NOWAIT is that it forces SQL Server to flush
> the output buffer.
Right, this is why you usually see the PRINT and the RAISERROR come to the
messages pane at roughly the same time, even if the PRINT is issued before a
delay and the RAISERROR comes after.
--
http://www.aspfaq.com/
(Reverse address to reply.)

Forcing display of QA's buffer

How can I force the contents of Query Analyzer's buffer to display to the
screen?
A stored proc has some debug PRINT statements in it. The proc takes a long
time to execute and the PRINT statements don't display until execution is
complete.
Is it possible to force them to display immediately? If so, how?
How about RAISERROR WITH NOWAIT? Watch the messages pane:
PRINT 'foo'
WAITFOR DELAY '00:00:05'
GO
RAISERROR('foo', 11, 1) WITH NOWAIT
WAITFOR DELAY '00:00:05'
GO
http://www.aspfaq.com/
(Reverse address to reply.)
"Dave" <dave@.nospam.ru> wrote in message
news:uyWPdkbHFHA.2784@.TK2MSFTNGP09.phx.gbl...
> How can I force the contents of Query Analyzer's buffer to display to the
> screen?
> A stored proc has some debug PRINT statements in it. The proc takes a
long
> time to execute and the PRINT statements don't display until execution is
> complete.
> Is it possible to force them to display immediately? If so, how?
>
|||Even better, use a severity of 10 or lower to emulate what PRINT does (i.e.,
no error condition raised)...
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:uVVzjnbHFHA.4048@.TK2MSFTNGP15.phx.gbl...[vbcol=seagreen]
> How about RAISERROR WITH NOWAIT? Watch the messages pane:
>
> PRINT 'foo'
> WAITFOR DELAY '00:00:05'
> GO
> RAISERROR('foo', 11, 1) WITH NOWAIT
> WAITFOR DELAY '00:00:05'
> GO
>
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Dave" <dave@.nospam.ru> wrote in message
> news:uyWPdkbHFHA.2784@.TK2MSFTNGP09.phx.gbl...
the[vbcol=seagreen]
> long
is
>
|||Thanks Aaron
That works and it also prints out any unprinted PRINT statements previous to
the RAISERROR.
THe red error messages are a distraction but I can live with that.
Thank you.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:uVVzjnbHFHA.4048@.TK2MSFTNGP15.phx.gbl...[vbcol=seagreen]
> How about RAISERROR WITH NOWAIT? Watch the messages pane:
>
> PRINT 'foo'
> WAITFOR DELAY '00:00:05'
> GO
> RAISERROR('foo', 11, 1) WITH NOWAIT
> WAITFOR DELAY '00:00:05'
> GO
>
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Dave" <dave@.nospam.ru> wrote in message
> news:uyWPdkbHFHA.2784@.TK2MSFTNGP09.phx.gbl...
the[vbcol=seagreen]
> long
is
>
|||Good point, just in the habit of using 11.
http://www.aspfaq.com/
(Reverse address to reply.)
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:egrs6xbHFHA.720@.TK2MSFTNGP10.phx.gbl...
> Even better, use a severity of 10 or lower to emulate what PRINT does
(i.e.,
> no error condition raised)...
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:uVVzjnbHFHA.4048@.TK2MSFTNGP15.phx.gbl...
> the
> is
>
|||> THe red error messages are a distraction but I can live with that.
Just follow Adam's advice and lower the severity level.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Dave" <dave@.nospam.ru> wrote in message news:emHu5xbHFHA.3780@.TK2MSFTNGP10.phx.gbl...
> Thanks Aaron
> That works and it also prints out any unprinted PRINT statements previous to
> the RAISERROR.
> THe red error messages are a distraction but I can live with that.
> Thank you.
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:uVVzjnbHFHA.4048@.TK2MSFTNGP15.phx.gbl...
> the
> is
>
|||Got it.
Thanks
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uj4f94bHFHA.3624@.tk2msftngp13.phx.gbl...
> Just follow Adam's advice and lower the severity level.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> http://www.sqlug.se/
>
> "Dave" <dave@.nospam.ru> wrote in message
news:emHu5xbHFHA.3780@.TK2MSFTNGP10.phx.gbl...[vbcol=seagreen]
previous to[vbcol=seagreen]
a[vbcol=seagreen]
execution
>
|||did you try using "results in text" instead of "results in grid"?
Dave wrote:
> How can I force the contents of Query Analyzer's buffer to display to the
> screen?
> A stored proc has some debug PRINT statements in it. The proc takes a long
> time to execute and the PRINT statements don't display until execution is
> complete.
> Is it possible to force them to display immediately? If so, how?
|||SQL Server doesn't send its output to the client immediately as it is generated by the engine. This
is to consume less network resources. And this is the reason why we don't see things like PRINT
immediately after they have been performed. SQL Server will wait until its output buffer is full, or
until the batch has ended. The trick with RAISERROR and NOWAIT is that it forces SQL Server to flush
the output buffer.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"ch" <ch@.dontemailme.com> wrote in message news:42237E8F.7DC18B52@.dontemailme.com...[vbcol=seagreen]
> did you try using "results in text" instead of "results in grid"?
>
> Dave wrote:
|||> The trick with RAISERROR and NOWAIT is that it forces SQL Server to flush
> the output buffer.
Right, this is why you usually see the PRINT and the RAISERROR come to the
messages pane at roughly the same time, even if the PRINT is issued before a
delay and the RAISERROR comes after.
http://www.aspfaq.com/
(Reverse address to reply.)

Friday, March 23, 2012

Forcing display of QA's buffer

How can I force the contents of Query Analyzer's buffer to display to the
screen?
A stored proc has some debug PRINT statements in it. The proc takes a long
time to execute and the PRINT statements don't display until execution is
complete.
Is it possible to force them to display immediately? If so, how?How about RAISERROR WITH NOWAIT? Watch the messages pane:
PRINT 'foo'
WAITFOR DELAY '00:00:05'
GO
RAISERROR('foo', 11, 1) WITH NOWAIT
WAITFOR DELAY '00:00:05'
GO
http://www.aspfaq.com/
(Reverse address to reply.)
"Dave" <dave@.nospam.ru> wrote in message
news:uyWPdkbHFHA.2784@.TK2MSFTNGP09.phx.gbl...
> How can I force the contents of Query Analyzer's buffer to display to the
> screen?
> A stored proc has some debug PRINT statements in it. The proc takes a
long
> time to execute and the PRINT statements don't display until execution is
> complete.
> Is it possible to force them to display immediately? If so, how?
>|||Even better, use a severity of 10 or lower to emulate what PRINT does (i.e.,
no error condition raised)...
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:uVVzjnbHFHA.4048@.TK2MSFTNGP15.phx.gbl...
> How about RAISERROR WITH NOWAIT? Watch the messages pane:
>
> PRINT 'foo'
> WAITFOR DELAY '00:00:05'
> GO
> RAISERROR('foo', 11, 1) WITH NOWAIT
> WAITFOR DELAY '00:00:05'
> GO
>
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Dave" <dave@.nospam.ru> wrote in message
> news:uyWPdkbHFHA.2784@.TK2MSFTNGP09.phx.gbl...
the[vbcol=seagreen]
> long
is[vbcol=seagreen]
>|||Thanks Aaron
That works and it also prints out any unprinted PRINT statements previous to
the RAISERROR.
THe red error messages are a distraction but I can live with that.
Thank you.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:uVVzjnbHFHA.4048@.TK2MSFTNGP15.phx.gbl...
> How about RAISERROR WITH NOWAIT? Watch the messages pane:
>
> PRINT 'foo'
> WAITFOR DELAY '00:00:05'
> GO
> RAISERROR('foo', 11, 1) WITH NOWAIT
> WAITFOR DELAY '00:00:05'
> GO
>
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Dave" <dave@.nospam.ru> wrote in message
> news:uyWPdkbHFHA.2784@.TK2MSFTNGP09.phx.gbl...
the[vbcol=seagreen]
> long
is[vbcol=seagreen]
>|||Good point, just in the habit of using 11.
http://www.aspfaq.com/
(Reverse address to reply.)
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:egrs6xbHFHA.720@.TK2MSFTNGP10.phx.gbl...
> Even better, use a severity of 10 or lower to emulate what PRINT does
(i.e.,
> no error condition raised)...
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:uVVzjnbHFHA.4048@.TK2MSFTNGP15.phx.gbl...
> the
> is
>|||> THe red error messages are a distraction but I can live with that.
Just follow Adam's advice and lower the severity level.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Dave" <dave@.nospam.ru> wrote in message news:emHu5xbHFHA.3780@.TK2MSFTNGP10.phx.gbl...[vbcol
=seagreen]
> Thanks Aaron
> That works and it also prints out any unprinted PRINT statements previous
to
> the RAISERROR.
> THe red error messages are a distraction but I can live with that.
> Thank you.
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:uVVzjnbHFHA.4048@.TK2MSFTNGP15.phx.gbl...
> the
> is
>[/vbcol]|||Got it.
Thanks
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uj4f94bHFHA.3624@.tk2msftngp13.phx.gbl...
> Just follow Adam's advice and lower the severity level.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> http://www.sqlug.se/
>
> "Dave" <dave@.nospam.ru> wrote in message
news:emHu5xbHFHA.3780@.TK2MSFTNGP10.phx.gbl...
previous to[vbcol=seagreen]
a[vbcol=seagreen]
execution[vbcol=seagreen]
>|||did you try using "results in text" instead of "results in grid"?
Dave wrote:
> How can I force the contents of Query Analyzer's buffer to display to the
> screen?
> A stored proc has some debug PRINT statements in it. The proc takes a lon
g
> time to execute and the PRINT statements don't display until execution is
> complete.
> Is it possible to force them to display immediately? If so, how?|||SQL Server doesn't send its output to the client immediately as it is genera
ted by the engine. This
is to consume less network resources. And this is the reason why we don't se
e things like PRINT
immediately after they have been performed. SQL Server will wait until its o
utput buffer is full, or
until the batch has ended. The trick with RAISERROR and NOWAIT is that it fo
rces SQL Server to flush
the output buffer.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"ch" <ch@.dontemailme.com> wrote in message news:42237E8F.7DC18B52@.dontemailme.com...[vbcol=s
eagreen]
> did you try using "results in text" instead of "results in grid"?
>
> Dave wrote:|||> The trick with RAISERROR and NOWAIT is that it forces SQL Server to flush
> the output buffer.
Right, this is why you usually see the PRINT and the RAISERROR come to the
messages pane at roughly the same time, even if the PRINT is issued before a
delay and the RAISERROR comes after.
http://www.aspfaq.com/
(Reverse address to reply.)sql

Monday, March 19, 2012

Force list to stay in same place on repeat pages?

Is there some way to force a list (or table) to print in the same place
on repeat pages as it does on the first page?
Say for instance on the first page the list starts 2 inches from the
top, can I make it so on continuation pages the list always starts 2
inches from the top? Instead of starting from the top of the second
page?
What I really need is for the list to always print in a fixed
rectangle, say start 2 inches from the top, and stop 2 inches from the
bottom. Even on the continuation pages. Is this possible?
thanks-JimCan you just do this by adding page headers and footers to the report that
will regulate this? Or are there other complexities to your report that are
not mentioned?
--
Douglas McDowell douglas@.nospam.solidqualitylearning.com
"jim_slc" <jim_slc@.yahoo.com> wrote in message
news:1135899791.488352.157070@.g47g2000cwa.googlegroups.com...
> Is there some way to force a list (or table) to print in the same place
> on repeat pages as it does on the first page?
> Say for instance on the first page the list starts 2 inches from the
> top, can I make it so on continuation pages the list always starts 2
> inches from the top? Instead of starting from the top of the second
> page?
> What I really need is for the list to always print in a fixed
> rectangle, say start 2 inches from the top, and stop 2 inches from the
> bottom. Even on the continuation pages. Is this possible?
> thanks-Jim
>|||Thanks for the reply Douglas. Once I figured out that having the
header/body/trailer fill the whole page I got it close enough.

Sunday, February 19, 2012

Footer problems

Hi all,
I've got a couple of problems with some reports that I'm developing:
1) I'm trying to print a Group Footer at the bottom of the page in a fixed
position, regardless of how many detail records there are. Is there a way
to do this?
2) I have another report that is supposed to give page totals on each page,
as well as a grand total at the end of the report. Since I can't put any
fields in the Page Footer, and I can't use the Global Page variables in the
Body, how can I get these totals to appear correctly?
Thank you very much in advance,
JimJim wrote:
> Hi all,
> I've got a couple of problems with some reports that I'm developing:
> 1) I'm trying to print a Group Footer at the bottom of the page in a
> fixed position, regardless of how many detail records there are. Is
> there a way to do this?
> 2) I have another report that is supposed to give page totals on each
> page, as well as a grand total at the end of the report. Since I
> can't put any fields in the Page Footer, and I can't use the Global
> Page variables in the Body, how can I get these totals to appear
> correctly?
> Thank you very much in advance,
> Jim
I'll tackle number 2 first;
In a table footer you can use the 'RunningValue' function instead of
'Sum' and make sure the footer is set to 'Repeat on each page'.
Number 1 is not currently acheivable.
Rectangles are the key to semi-absolute positioning, but unless your
report is alway a one page report (i.e. an invoice) you won't be able
to do it.
Merry Christmas
Chris|||HI
I am also trying to do the same. But I cannot achieve it. Which scope do I
have to give' Can you please give me an example?
"Chris McGuigan" wrote:
> Jim wrote:
> > Hi all,
> >
> > I've got a couple of problems with some reports that I'm developing:
> >
> > 1) I'm trying to print a Group Footer at the bottom of the page in a
> > fixed position, regardless of how many detail records there are. Is
> > there a way to do this?
> >
> > 2) I have another report that is supposed to give page totals on each
> > page, as well as a grand total at the end of the report. Since I
> > can't put any fields in the Page Footer, and I can't use the Global
> > Page variables in the Body, how can I get these totals to appear
> > correctly?
> >
> > Thank you very much in advance,
> >
> > Jim
> I'll tackle number 2 first;
> In a table footer you can use the 'RunningValue' function instead of
> 'Sum' and make sure the footer is set to 'Repeat on each page'.
> Number 1 is not currently acheivable.
> Rectangles are the key to semi-absolute positioning, but unless your
> report is alway a one page report (i.e. an invoice) you won't be able
> to do it.
> Merry Christmas
> Chris
>|||Hey Soan,
I actually have found out how to do this stuff, although it was pretty
nasty. MS needs to come up with something better than it has thus far.
First off, the RunningValue function did not work for me in the table
footer. What I ended up doing was adding another Detail row, and added an
expression to the Hidden property of that row that hides it unless it goes
at the bottom of the page. I calculated the number of detail rows that fit
on each page, then used the Mod function of the RowNumber as such:
RowNumber(Nothing) Mod x = 0, where x is the number of rows that fit in a
page. I then added a TextBox to that new Detail row and included the
RunningValue function in it; that worked!
As for positioning on the page, well, that is similar. I have two stored
procedures, one of which calculates the total number of detail rows that
will show up on the report, then subtracts that from the (number of pages *
max rows per page). I then created a dummy table with no controls in the
detail row (no header or footer row either), and set the row source to that
extra row calculation sproc. This worked, but I hate it.
FYI, I tried Chris' solution of using rectangles, but I couldn't get the
Height property to accept an expression (according to BOL, it shouldn't
anyway), so I have no idea how he meant I could use rectangles.
Jim
"Soan" <Soan@.discussions.microsoft.com> wrote in message
news:01963902-278F-4A66-BE25-276F8115F8B1@.microsoft.com...
> HI
> I am also trying to do the same. But I cannot achieve it. Which scope do I
> have to give' Can you please give me an example?
>
> "Chris McGuigan" wrote:
>> Jim wrote:
>> > Hi all,
>> >
>> > I've got a couple of problems with some reports that I'm developing:
>> >
>> > 1) I'm trying to print a Group Footer at the bottom of the page in a
>> > fixed position, regardless of how many detail records there are. Is
>> > there a way to do this?
>> >
>> > 2) I have another report that is supposed to give page totals on each
>> > page, as well as a grand total at the end of the report. Since I
>> > can't put any fields in the Page Footer, and I can't use the Global
>> > Page variables in the Body, how can I get these totals to appear
>> > correctly?
>> >
>> > Thank you very much in advance,
>> >
>> > Jim
>> I'll tackle number 2 first;
>> In a table footer you can use the 'RunningValue' function instead of
>> 'Sum' and make sure the footer is set to 'Repeat on each page'.
>> Number 1 is not currently acheivable.
>> Rectangles are the key to semi-absolute positioning, but unless your
>> report is alway a one page report (i.e. an invoice) you won't be able
>> to do it.
>> Merry Christmas
>> Chris|||Hi Jim/Soan,
Soan, you asked about scope, generally I use 'Nothing' which instructs
RS to work it out for you! For basic reports you could use the dataset
name (in double quotes!).
You can set a group footer to repeat on each page (see 'Edit Group
Properties' and check 'Repeat Footer on each page')
Use the RunningValue function of the form
RunningValue(Fields!Amount.Value, Sum, Nothing), this should do it.
Note! This is not a page total but a running total!
Jim, your method is fine as long as you don't start grouping or have
conditionally hidden lines, then tracking where you are on the page
becomes a nightmare.
The rectangle solution only really works if can get prints on one page.
You place a rectangle exactly where you want it on the page and how big
you want, then place a data region inside it and make the data region
display what you want, i.e. the totals.
As Jim said, Microsoft haven't really provided an adequate way of
achieving this.
Regards
Chris
Jim wrote:
> Hey Soan,
> I actually have found out how to do this stuff, although it was
> pretty nasty. MS needs to come up with something better than it has
> thus far.
> First off, the RunningValue function did not work for me in the table
> footer. What I ended up doing was adding another Detail row, and
> added an expression to the Hidden property of that row that hides it
> unless it goes at the bottom of the page. I calculated the number of
> detail rows that fit on each page, then used the Mod function of the
> RowNumber as such: RowNumber(Nothing) Mod x = 0, where x is the
> number of rows that fit in a page. I then added a TextBox to that
> new Detail row and included the RunningValue function in it; that
> worked!
> As for positioning on the page, well, that is similar. I have two
> stored procedures, one of which calculates the total number of detail
> rows that will show up on the report, then subtracts that from the
> (number of pages * max rows per page). I then created a dummy table
> with no controls in the detail row (no header or footer row either),
> and set the row source to that extra row calculation sproc. This
> worked, but I hate it.
> FYI, I tried Chris' solution of using rectangles, but I couldn't get
> the Height property to accept an expression (according to BOL, it
> shouldn't anyway), so I have no idea how he meant I could use
> rectangles.
> Jim
> "Soan" <Soan@.discussions.microsoft.com> wrote in message
> news:01963902-278F-4A66-BE25-276F8115F8B1@.microsoft.com...
> > HI
> >
> > I am also trying to do the same. But I cannot achieve it. Which
> > scope do I have to give' Can you please give me an example?
> >
> >
> > "Chris McGuigan" wrote:
> >
> >> Jim wrote:
> > >
> >> > Hi all,
> >> >
> >> > I've got a couple of problems with some reports that I'm
> developing: >> >
> >> > 1) I'm trying to print a Group Footer at the bottom of the page
> in a >> > fixed position, regardless of how many detail records there
> are. Is >> > there a way to do this?
> >> >
> >> > 2) I have another report that is supposed to give page totals on
> each >> > page, as well as a grand total at the end of the report.
> Since I >> > can't put any fields in the Page Footer, and I can't use
> the Global >> > Page variables in the Body, how can I get these
> totals to appear >> > correctly?
> >> >
> >> > Thank you very much in advance,
> >> >
> >> > Jim
> > >
> >> I'll tackle number 2 first;
> >> In a table footer you can use the 'RunningValue' function instead
> of >> 'Sum' and make sure the footer is set to 'Repeat on each page'.
> > >
> >> Number 1 is not currently acheivable.
> >> Rectangles are the key to semi-absolute positioning, but unless
> your >> report is alway a one page report (i.e. an invoice) you won't
> be able >> to do it.
> > >
> >> Merry Christmas
> >> Chris
> >>