Showing posts with label apologies. Show all posts
Showing posts with label apologies. Show all posts

Monday, March 26, 2012

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
> >>
> >>
> >>
>
>

Monday, March 12, 2012

FOR XML? UPDATED ANSWER (WAS: Newbie question...)

Apologies on the last post. I did not see FOR XML and was thinking of other
SQL capabilities.
FOR XML creates a valid XML snippet, without root tags. This gives you a
couple of choices.
1. Create templates that supply root tags
2. Supply root tags in your program
For XML input into SQL Server, you WILL end up with a blow up, as mentioned
in the prior response.
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"VK" wrote:

> Hi,
> Will SQL XML (when we use FOR XML) perform check to make sure that XML
> document is in proper form or do we have to use a third party s/w like
> Altova to check for correctly created XML document?
> Many thanks for your time.
> *** Sent via Developersdex http://www.codecomments.com ***
> Don't just participate in USENET...get rewarded for it!
>
Let me clarify this a bit further.
FOR XML in most cases (except for invalid characters and when using the
xmltext directive in EXPLICIT mode) will generate well-formed fragments. You
can set a root property on your provider (ADO, ADO.net, or the HTTP ISAPI)
to have it wrapped.
When you use sp_xml_preparedocument to parse incoming XML data, you will get
an error message if the parsing fails. So it does not quite explode :-).
Best regards
Michael
"Cowboy (Gregory A. Beamer) - MVP" <NoSpamMgbworld@.comcast.netNoSpamM> wrote
in message news:B30C9949-8C15-46CE-826B-4961014B9B19@.microsoft.com...[vbcol=seagreen]
> Apologies on the last post. I did not see FOR XML and was thinking of
> other
> SQL capabilities.
> FOR XML creates a valid XML snippet, without root tags. This gives you a
> couple of choices.
> 1. Create templates that supply root tags
> 2. Supply root tags in your program
> For XML input into SQL Server, you WILL end up with a blow up, as
> mentioned
> in the prior response.
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
> ***************************
> Think Outside the Box!
> ***************************
> "VK" wrote:

FOR XML? UPDATED ANSWER (WAS: Newbie question...)

Apologies on the last post. I did not see FOR XML and was thinking of other
SQL capabilities.
FOR XML creates a valid XML snippet, without root tags. This gives you a
couple of choices.
1. Create templates that supply root tags
2. Supply root tags in your program
For XML input into SQL Server, you WILL end up with a blow up, as mentioned
in the prior response.
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"VK" wrote:

> Hi,
> Will SQL XML (when we use FOR XML) perform check to make sure that XML
> document is in proper form or do we have to use a third party s/w like
> Altova to check for correctly created XML document?
> Many thanks for your time.
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!
>Let me clarify this a bit further.
FOR XML in most cases (except for invalid characters and when using the
xmltext directive in EXPLICIT mode) will generate well-formed fragments. You
can set a root property on your provider (ADO, ADO.net, or the HTTP ISAPI)
to have it wrapped.
When you use sp_xml_preparedocument to parse incoming XML data, you will get
an error message if the parsing fails. So it does not quite explode :-).
Best regards
Michael
"Cowboy (Gregory A. Beamer) - MVP" <NoSpamMgbworld@.comcast.netNoSpamM> wrote
in message news:B30C9949-8C15-46CE-826B-4961014B9B19@.microsoft.com...
> Apologies on the last post. I did not see FOR XML and was thinking of
> other
> SQL capabilities.
> FOR XML creates a valid XML snippet, without root tags. This gives you a
> couple of choices.
> 1. Create templates that supply root tags
> 2. Supply root tags in your program
> For XML input into SQL Server, you WILL end up with a blow up, as
> mentioned
> in the prior response.
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
> ***************************
> Think Outside the Box!
> ***************************
> "VK" wrote:
>