Showing posts with label display. Show all posts
Showing posts with label display. Show all posts

Friday, March 30, 2012

having problems with details selection

i have a packing slip report with 2 detail sections. can i select which details section to display/print as the line item based on whether the line item is a stock item (orderitem.type) =1 or a miscellaneous item (orderitem.type) = 3 ?? i don't want to use the suppress method, it needs to be one section or the other. thanksWhat's wrong with conditionally suppressing each detail sub-section as required? Would seem to be exactly what you want.

Wednesday, March 21, 2012

hash in RS

Hi,

I need to take the Social Security number and hash it into a unique identifier because I can't display Social Security numbers on a report.

Does Reporting Services have any encrypting/hashing routines that I can use?

Any suggestions?

Thanks.

You could write some code to do this, however there is no built-in functionality.

If it needs to be secure I would has the data within SQL Server. If you are using SQL 2005 there are some functions to do this.

Here is something that may relate.

http://blogs.msdn.com/lcris/archive/2005/12/22/506931.aspx

cheers!

|||

Maybe you can use the vb code in the following link in your report code and call the function to get the encrypted value:

http://www.freevbcode.com/ShowCode.asp?ID=4398

Or you can write a custom code in any of the .net supported language and use Encryption class in the BCL and refer to this custom code (.dll) and call the function again to get the excrypted value back.

Or in a simple way, display just "###-##-####" for all records instead of displaying the encrypted/hashed value because there is always a possibility that the hacker could decrypt the value.

Shyam

Monday, February 27, 2012

Handling NULLS - help!

I would like to display some text in a textbox conditional on the null/not
null value of a database field (called "ID").
I have tried various versions of the following:
=iif(len(trim(Fields!ID.Value))<1 OR (Fields!ID.Value IS
system.dbnull.value),"ID is null","ID is not null")
but I still get this error:
"The query returned no rows for the data set. The expression therefore
evaluates to null."
any suggestions?Try =IIF(IsNothing(Fields!ID.Value), ...|||Thanks Rose - that worked perfectly :)

Handling Languages in Reports

Hello,
I have a French and English user base and I would like to display reports in
the language of preference of the user. However, I am not certain as to a
best practice for this within VStudio. In addition, how can I make the
reportserver display a french GUI?
Any help would be apprecaited,
--
RyanHi Ryan,
My understanding of this issue is: You want to show different layout based
on different language in reporting services. If I misunderstood your
concern, please feel free to let me know.
You can use the locale settings on a client computer to determine how a
report appears to the user. For example, you can create a report that uses
a different query expression based on the locale information returned by
the User.Language global variable. The query may change to retrieve
localized information from a different column depending on the language
returned. You can also use an expression in the language settings of the
report or report items based on this variable.
While you can change the language settings of a report, you must be careful
about any display issues this may cause. For example, changing the locale
setting of the report can change the date format in the report, but it can
also change the currency format. Unless there is a conversion process in
place for the currency, this may cause the incorrect currency symbol to be
displayed in the report. To avoid this, set the language information on the
individual items that you want to change, or set the item with the currency
data to a specific language.
Here is a BOL article for your reference:
International Considerations for Reporting Services
http://msdn2.microsoft.com/en-us/library/ms156493(d=ide).aspx
Hope this will be helpful!
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Thank-you Wei,
I will have a look at that and I may have a follow-up question for you at a
later date.
--
Ryan
"Wei Lu [MSFT]" wrote:
> Hi Ryan,
> My understanding of this issue is: You want to show different layout based
> on different language in reporting services. If I misunderstood your
> concern, please feel free to let me know.
> You can use the locale settings on a client computer to determine how a
> report appears to the user. For example, you can create a report that uses
> a different query expression based on the locale information returned by
> the User.Language global variable. The query may change to retrieve
> localized information from a different column depending on the language
> returned. You can also use an expression in the language settings of the
> report or report items based on this variable.
> While you can change the language settings of a report, you must be careful
> about any display issues this may cause. For example, changing the locale
> setting of the report can change the date format in the report, but it can
> also change the currency format. Unless there is a conversion process in
> place for the currency, this may cause the incorrect currency symbol to be
> displayed in the report. To avoid this, set the language information on the
> individual items that you want to change, or set the item with the currency
> data to a specific language.
> Here is a BOL article for your reference:
> International Considerations for Reporting Services
> http://msdn2.microsoft.com/en-us/library/ms156493(d=ide).aspx
> Hope this will be helpful!
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================> This posting is provided "AS IS" with no warranties, and confers no rights.
>|||Hi Ryan,
Thank you for your update.
I will close this issue now and if you have any questions about this issue,
please feel free to re-enter the newsgroup and post it under this thread. I
will reply as soon as possible.
Have a nice day!
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.

Handling Images from database

I want to get an image field and display that image on the report for corresponding records.did you store it in a database?
If so place that field in the Report and see if it is printing

Handling errors returned by SSRS

We are displaying the report in our reporting application but we do not want to display errors from SSRS to the user. We want to handle the errors and display a user friendly message.

How can that be done?. We are making URL access to the report server.

Thanks.

Please help me to understand this better. If you use URL addressability what application layer will handle the error messages? If you use the VS.NET 2005 Report Viewer control, your application can handle the ReportError event.|||

Alright,

So we are using an iframe in our application which we are making a url call to the report server. Hence, if there is a problem like "access" denied, we do not want the iframe to read "SQL Server error" but have some error that shows that the user is interacting with our application. This can only be done if on the report server we could write some generic error page which will always get called anytime ssrs throws an error.

Thanks.

|||Sorry, you are out of lack here. URL addressability is certainly very easy but not that flexible. Same limitations apply as invoking a server-side web page by URL.|||

Hi,

I have my report viewer control and reporterror event to handel all the exception.Do we need to call the reporterror event in my code or automatically it will be called when error occurs?

Thanks,

Ranjan

|||Not sure what you mean by call the event. The event handler will be called for you when the event happens (in this case the report errors out).|||

Hi Teo,

If u have any sample code of how to show a report in reportviewer along with reporterror event and if you can post it here it would be very helpful.

Thanks,

Ranjan

|||

private void reportViewer1_ReportError(object sender, Microsoft.Reporting.WinForms.ReportErrorEventArgs e)

{

// use e.Exception to get to the exception

// set e.Handled to true to prevent the ReportViewer from displaying an error message.

}

More about ReportViewer in this article.

Handling errors returned by SSRS

We are displaying the report in our reporting application but we do not want to display errors from SSRS to the user. We want to handle the errors and display a user friendly message.

How can that be done?. We are making URL access to the report server.

Thanks.

Please help me to understand this better. If you use URL addressability what application layer will handle the error messages? If you use the VS.NET 2005 Report Viewer control, your application can handle the ReportError event.|||

Alright,

So we are using an iframe in our application which we are making a url call to the report server. Hence, if there is a problem like "access" denied, we do not want the iframe to read "SQL Server error" but have some error that shows that the user is interacting with our application. This can only be done if on the report server we could write some generic error page which will always get called anytime ssrs throws an error.

Thanks.

|||Sorry, you are out of lack here. URL addressability is certainly very easy but not that flexible. Same limitations apply as invoking a server-side web page by URL.|||

Hi,

I have my report viewer control and reporterror event to handel all the exception.Do we need to call the reporterror event in my code or automatically it will be called when error occurs?

Thanks,

Ranjan

|||Not sure what you mean by call the event. The event handler will be called for you when the event happens (in this case the report errors out).|||

Hi Teo,

If u have any sample code of how to show a report in reportviewer along with reporterror event and if you can post it here it would be very helpful.

Thanks,

Ranjan

|||

private void reportViewer1_ReportError(object sender, Microsoft.Reporting.WinForms.ReportErrorEventArgs e)

{

// use e.Exception to get to the exception

// set e.Handled to true to prevent the ReportViewer from displaying an error message.

}

More about ReportViewer in this article.

Friday, February 24, 2012

Handling a Null datetime column

can anybody tell me how to do a select query on a datetime field where if i have a null value in that column, i need to display a some character.

ISNULL is a lovely function useful for doing just that.

ISNULL(MyDateColumn, 'ITS NULL!')

returns ITS NULL if column MyDateColumn's value is NULL

|||

select donor_id,isnull(check_date,'No Value') from donors where check_date is null

If the column check_date consists the null value U will get the value No Value.

Thank u

Baba

Please remember to click "Mark as Answer" on this post if it helped you.


|||I would say it depends what is the type of your field. If your filed is data time you shoudl convert it to string for output to not have problems with data type.Looks that ISNULL is trying to convert default for null value to the same type like tested value so you you would like to use syntax like this:ISNULL(DateField, 'Null date')It can not work because SQL will try to convert you "NUll Date" to be datetime and will fail. So you have to use different syntax:ISNULL(convert(varchar(20),DateField), 'Null date')and this should work but returned column will be varchar(20) not datetime.In case you need datetime column just left nulls inside or use first valid date :ISNULL(DateField, '00:00')it will replace all nulls by date '01/01/1900 00:00' Bu I think that keeping null is better.|||

ISNULL wont work with datetime a column if we r replacing with some characters. so in this case whatjpazgiermentioned is right.but in that too there is a flaw. what i got here is we need to check for each part of the datetime value for NULL.like dd/mm/yyyy, then hh:mm:ss,then am/pm.

so the query will be like


SELECT column1,Isnull(
(convert(varchar(20),columnDate,101) + ' ' + convert(varchar(20),columnDate,108) + ' ' + right(convert(varchar(20),columnDate),2)),'-') column2 from table1

im not sure if the above mentioned is the best solution possible.if anyone have any easy method other than this please reply.