Showing posts with label customer. Show all posts
Showing posts with label customer. Show all posts

Friday, March 9, 2012

Dynamically changing position of Textbox

Hi,

In my report, I've to print the address of the customer in a form which is in a pre-defined format. So while printing, the line number and position should be specified by the user. Is there any ways in SSRS to change the position of a textbox/any control dynamically by inputing the x and y coordinates? If there is a way please let me know that.

Thanks in Advance,

Leks

What does the surrounding content in the layout look like? Do you have a "clear" region in which you could place a very large textbox, representing the all the page area in which the textbox could potentially be placed?

If so, you might be able to do this with padding. IOW, you would place this very large textbox in the layout and then you would pad the top and left to "push" the content of the text box into the customer's preferred position, at runtime.

This is possible because you can express the padding values as expressions. Think of the textbox's true top and left as an offset from 0,0, which you will subtract from the customer's input values (which will be parameters) to get the padded top and left at runtime.

HTH,

>L<

|||

Hi Lisa,

Thanks for your quick reply. But unfortunately my layout is not clear. It contains other data too that I need to position according to the input for them. For each item in the report we have to enter the position. I know this process is a bit tedious. but there is no other ways. They actualy need the report data such that it can be printed in many forms. Please reply as soon as possible.

Thank you dear,

Leks

|||

Hi Leks,

If you have to enter the position of each item in the report, then I think your best option is to edit the RDL on the fly, put your coordinates right in the report definition.

Are you comfortable with doing this? It may be quite straightward. Some things that would enter into it and might change what you have to do would include:

* -- What type of data region are you using (list/table) to contain the dynamic items?

* -- Are there additional items in the report that are *not* dynamically positioned, for example is this an order header you are trying to position so that it fits in a window envelope with a table of order lines that is relatively static?

>L<

|||

Hi Lisa,

Here all the data should change position dynamically. So Your solution shoud work. But I didnt get it. How we can change the rdl on the fly?

Thanking you,

Leks

|||

You can write a whole RDL on the fly if you want to. Look for an example called something like "generate RDL dynamically" on http://gotreportviewer.com/ and there is another example there that will show you how to LoadReportDefinition for a local report from a stream. If the report is a serverreport, you could use the SOAP API to upload the adjusted report definition instead.

In your case, I don't think that it will be necessary to write the whole RDL from scratch (although you will still have to load or upload your revised version). You can have a "template" RDL that you adjust, for each run or each customer, or as needed.

There are two ways to do an RDL template revision, the way I would do it and the way most developers would prefer to do it <g>. I prefer XSLT; in this case I might have a parameter in the XSLT for each positionable item in the report, or pass the entire set of adjustments in the form of a lookup document. If you prefer to load up the RDL in the DOM and select the textboxes as nodes to adjust each of them, this is pretty easy too.

Do you need more help than this, or is this what you're looking for?

>L<

|||

Hi Lisa,

Yes. This was what I was looking for. Now I know that using the XSLT we can position the textbox or any control dynamically.

Thank you so much Lisa,

Leks

|||

Great -- if you get stuck, holler. I am very willing to go the extra mile for other folks who like XSLT <s>.

>L<

Dynamically changing position of Textbox

Hi,

In my report, I've to print the address of the customer in a form which is in a pre-defined format. So while printing, the line number and position should be specified by the user. Is there any ways in SSRS to change the position of a textbox/any control dynamically by inputing the x and y coordinates? If there is a way please let me know that.

Thanks in Advance,

Leks

What does the surrounding content in the layout look like? Do you have a "clear" region in which you could place a very large textbox, representing the all the page area in which the textbox could potentially be placed?

If so, you might be able to do this with padding. IOW, you would place this very large textbox in the layout and then you would pad the top and left to "push" the content of the text box into the customer's preferred position, at runtime.

This is possible because you can express the padding values as expressions. Think of the textbox's true top and left as an offset from 0,0, which you will subtract from the customer's input values (which will be parameters) to get the padded top and left at runtime.

HTH,

>L<

|||

Hi Lisa,

Thanks for your quick reply. But unfortunately my layout is not clear. It contains other data too that I need to position according to the input for them. For each item in the report we have to enter the position. I know this process is a bit tedious. but there is no other ways. They actualy need the report data such that it can be printed in many forms. Please reply as soon as possible.

Thank you dear,

Leks

|||

Hi Leks,

If you have to enter the position of each item in the report, then I think your best option is to edit the RDL on the fly, put your coordinates right in the report definition.

Are you comfortable with doing this? It may be quite straightward. Some things that would enter into it and might change what you have to do would include:

* -- What type of data region are you using (list/table) to contain the dynamic items?

* -- Are there additional items in the report that are *not* dynamically positioned, for example is this an order header you are trying to position so that it fits in a window envelope with a table of order lines that is relatively static?

>L<

|||

Hi Lisa,

Here all the data should change position dynamically. So Your solution shoud work. But I didnt get it. How we can change the rdl on the fly?

Thanking you,

Leks

|||

You can write a whole RDL on the fly if you want to. Look for an example called something like "generate RDL dynamically" on http://gotreportviewer.com/ and there is another example there that will show you how to LoadReportDefinition for a local report from a stream. If the report is a serverreport, you could use the SOAP API to upload the adjusted report definition instead.

In your case, I don't think that it will be necessary to write the whole RDL from scratch (although you will still have to load or upload your revised version). You can have a "template" RDL that you adjust, for each run or each customer, or as needed.

There are two ways to do an RDL template revision, the way I would do it and the way most developers would prefer to do it <g>. I prefer XSLT; in this case I might have a parameter in the XSLT for each positionable item in the report, or pass the entire set of adjustments in the form of a lookup document. If you prefer to load up the RDL in the DOM and select the textboxes as nodes to adjust each of them, this is pretty easy too.

Do you need more help than this, or is this what you're looking for?

>L<

|||

Hi Lisa,

Yes. This was what I was looking for. Now I know that using the XSLT we can position the textbox or any control dynamically.

Thank you so much Lisa,

Leks

|||

Great -- if you get stuck, holler. I am very willing to go the extra mile for other folks who like XSLT <s>.

>L<

Friday, February 17, 2012

Dynamic SQL Newbie needs urgent help

Have a report that is working fine. Customer wants to add another field to
it. I have a field name of navigationPK to get the field they want. Only
problem is is that the navigationPK can be a primary key from any number of
tables.
Scenario......
Have a usertask displayed on dashboard....need to do a report on all
overdue tasks. Each task has a particular navigationpk. This navpk can be
linked to three or four tables. ie....navpk 1189134 could be the pk in a
tpp table, rvc table or a tr table. Need to ascertain which one it is so
that I can get the relevant additional field from each table.
Kinda hard to explain. But if anybody wants anymore info then please ask.
I was told to do dynamic sql...only prob is I have no idea where to start
and how to fit into existing script. Below is my initial script....works
fine so far. Needs tidying up I know, but essentially it works.
select fulllegalname, p.Id AS PersonId, dali.Name As DDCMAreaName,
ut.UserName As UTUserName, ut.MessageBody AS Task, ut.NavigationPK as NavPK,
ut.DueDate As DueDate
--h.id as HerdId
from person p
--INNER JOIN personherdrole phr on p.id = phr.personid
--INNER JOIN herd h on phr.Herdid = h.id
INNER JOIN personddcmarealink pdal on pdal.personId = p.Id
INNER JOIN ddcmarealookupitem dali on pdal.ddcmarealookupitemId = dali.Id
INNER JOIN usertask ut on ut.UserName = p.UserName
where (ut.DeletedDate IS NULL) and (ut.DueDate < getdate())
The additional field required is the herdid, and this herdid could be from
the tpp table, rvc table, tr table .
Help please. Going round in circles and not sure where to start.Article about dynamic sql
http://www.sommarskog.se/dynamic_sql.html
You did not describe the rules as to how you know which table it will be in.
Can it be in multiple tables but you only want a specific one?
Or the HerdID will only be in one of the tables?
If so
select fulllegalname, p.Id AS PersonId, dali.Name As DDCMAreaName,
ut.UserName As UTUserName, ut.MessageBody AS Task, ut.NavigationPK as NavPK,
ut.DueDate As DueDate
--h.id as HerdId
from person p
INNER JOIN personherdrole phr on p.id = phr.personid
INNER JOIN herd h on phr.Herdid = h.id
INNER JOIN personddcmarealink pdal on pdal.personId = p.Id
INNER JOIN ddcmarealookupitem dali on pdal.ddcmarealookupitemId = dali.Id
INNER JOIN usertask ut on ut.UserName = p.UserName
Inner JOIN (SELECT newfield, HerdID
FROM tpp
UNION
SELECT newfield, HerdID
FROM rvc
UNION
SELECT newfield, HerdID
FROM tr ) DerivedTable on DerivedTable.HerdID=HERD.id
where (ut.DeletedDate IS NULL) and (ut.DueDate < getdate())
No Dynamic required
"Nat Johnson" wrote:
> Have a report that is working fine. Customer wants to add another field to
> it. I have a field name of navigationPK to get the field they want. Only
> problem is is that the navigationPK can be a primary key from any number of
> tables.
> Scenario......
> Have a usertask displayed on dashboard....need to do a report on all
> overdue tasks. Each task has a particular navigationpk. This navpk can be
> linked to three or four tables. ie....navpk 1189134 could be the pk in a
> tpp table, rvc table or a tr table. Need to ascertain which one it is so
> that I can get the relevant additional field from each table.
> Kinda hard to explain. But if anybody wants anymore info then please ask.
> I was told to do dynamic sql...only prob is I have no idea where to start
> and how to fit into existing script. Below is my initial script....works
> fine so far. Needs tidying up I know, but essentially it works.
> select fulllegalname, p.Id AS PersonId, dali.Name As DDCMAreaName,
> ut.UserName As UTUserName, ut.MessageBody AS Task, ut.NavigationPK as NavPK,
> ut.DueDate As DueDate
> --h.id as HerdId
>
> from person p
> --INNER JOIN personherdrole phr on p.id = phr.personid
> --INNER JOIN herd h on phr.Herdid = h.id
> INNER JOIN personddcmarealink pdal on pdal.personId = p.Id
> INNER JOIN ddcmarealookupitem dali on pdal.ddcmarealookupitemId = dali.Id
> INNER JOIN usertask ut on ut.UserName = p.UserName
> where (ut.DeletedDate IS NULL) and (ut.DueDate < getdate())
>
> The additional field required is the herdid, and this herdid could be from
> the tpp table, rvc table, tr table .
> Help please. Going round in circles and not sure where to start.
>|||1. create your select statement
2 run the select statement and generate fields
3. generate report
last but not least turn the sql into a string after you have everything
working. us a report parameter to pass the dynamic part to the querry.
like this
="select * from " + Parameters!company.value
its that easy.
rmartinez wrote:
>Article about dynamic sql
>http://www.sommarskog.se/dynamic_sql.html
>You did not describe the rules as to how you know which table it will be in.
>Can it be in multiple tables but you only want a specific one?
>Or the HerdID will only be in one of the tables?
>If so
>select fulllegalname, p.Id AS PersonId, dali.Name As DDCMAreaName,
>ut.UserName As UTUserName, ut.MessageBody AS Task, ut.NavigationPK as NavPK,
>ut.DueDate As DueDate
>--h.id as HerdId
>from person p
>INNER JOIN personherdrole phr on p.id = phr.personid
>INNER JOIN herd h on phr.Herdid = h.id
>INNER JOIN personddcmarealink pdal on pdal.personId = p.Id
>INNER JOIN ddcmarealookupitem dali on pdal.ddcmarealookupitemId = dali.Id
>INNER JOIN usertask ut on ut.UserName = p.UserName
>Inner JOIN (SELECT newfield, HerdID
> FROM tpp
> UNION
> SELECT newfield, HerdID
> FROM rvc
> UNION
> SELECT newfield, HerdID
> FROM tr ) DerivedTable on DerivedTable.HerdID=HERD.id
>where (ut.DeletedDate IS NULL) and (ut.DueDate < getdate())
>No Dynamic required
>> Have a report that is working fine. Customer wants to add another field to
>> it. I have a field name of navigationPK to get the field they want. Only
>[quoted text clipped - 31 lines]
>> Help please. Going round in circles and not sure where to start.
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-reporting/200508/1