Showing posts with label textbox. Show all posts
Showing posts with label textbox. Show all posts

Friday, March 30, 2012

Mark a textbox "not for data-csv export"

Is it possible to mark a textbox in a report to not be exported to csv. This
would be similar to the "Data Output" tab for textboxes - but for csv instead
of xml?Setting the DataElementOutput value affects all "data-centric" rendering
extensions. I.e. CSV and XML. You cannot control CSV specifically in this
case.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"DBA72" <DBA72@.discussions.microsoft.com> wrote in message
news:F6027B38-C0C4-4C89-B9B2-5CCD6A33987B@.microsoft.com...
> Is it possible to mark a textbox in a report to not be exported to csv.
> This
> would be similar to the "Data Output" tab for textboxes - but for csv
> instead
> of xml?sql

Margin rendering

When running a SSRS 2005 Report on local machines (running Windows XP) A certain Textbox Label is not wrapping and is sized with .25 inch blank spacing at the end of the text. When running thru a datadriven Subscription this label is wrapping to next line on the PDF file that is produced.

We went to the SSRS 2005 server( Windows server 2003) and opened the report and it shows this label wrapping and the text is not fitting in the label box. But on every client box that we open this report on it shows it not wrapping. Is there a setting on the Server that we need to set for this report to render correctly.

Hi Brad,

A couple questions for you:

1) Are all machines running the same version of SSRS?

2) Are you exporting to PDF in all cases?

3) Do the various servers on which the different reports run have differing DPI settings?

Many thanks,

Chris

Monday, March 12, 2012

Manipulating a text box in custom code.

Hi there,

A simple question I hope. I have got a textbox on a report and I'm trying to populate it by calling a custom assembly. I know I can reference it directly in the textbox (this works) but I am trying to do this from the code block. The following code didn't work:

Protected Overrides Sub OnInit()
ReportItems!textbox2.Value = POCCustomAssembly.CustAssembly.Hello()
End Sub

The TextBox is called textbox2 and the custom assembly simply returns a string.

I get an error message "The is an error on line 1 of custom code: [BC30469] Reference to a non-shared member requires an object reference".

What am I doing wrong?

Hi,

I know you submitted this months ago...but I was wondering if you found the solution to your problem? I essentially am trying to do the exact same thing and can't figure out the error. I would appreciate any help.

|||

The error message you're getting suggests that the code wouldn't even work in the textbox value property, although the message could be wrong and misleading.

Is the method you have in your assembly "Shared" (VB) or "static" (c#)?

If not, try to make it shared/static. If that's not possible to do,

you can add objects to the report in Report > Report Properties > References > Classes

add the class name and your desired instance name for the object. Then you can use this instance name in your custom code.

|||

Thank you for the responose. Here is my code:

I basically wrote an assembly to calculate percentages and handle situations to divide by zero.

namespace Calculations

{

public class calcPercentage

{

public decimal Percentage(decimal decValueOne, decimal decValueTwo)

{

decimal decPercentage = 0;

if (decValueOne == 0 || decValueTwo == 0)

{

decPercentage = 0;

}

else

{

decPercentage = (decValueOne - decValueTwo) / decValueOne;

}

return decPercentage;

}

}

}

Then in my textbox I put:

=Calculations.CalcPercentage.Percentage(SUM(Fields!PreviousYTDExpenseAmount.Value, "Template_OutputData_Sales"), SUM(Fields!PreviousYTDExpenseAmount.Value, "Template_OutputData_CGS"))

I referenced the assembly and added it to C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies and I still get that error message so I do not know what the problem is.

Then after carefully reading your response, I realized I didn't write "static" in my method even though that's what I meant it to be. Now the program builds successfully but when I run it and try to produce the PDF file it catches on error when it tries to render it as a PDF. Now to figure out that error...which I will save for tomorrow....I must have screwed something up in the process.

Thanks so much for you help! If you have any suggestions about my next error...i'm all ears!

|||Also, when I removed the assembly from my report and reran it they worked fine...so if you have any suggestions let me know.|||

I cannot get the report to render to design mode while using a custom assembly. As soon as I remove the assembly, it works just fine. can anyone suggest what might be the problem? All my code is listed above and what steps I have already taken.

Thanks!

|||

Any custom assemblies used for SSRS must be declared SHARED for VB or STATIC for C#.

So for instance:

vb sample:

Public Class Class1

Public Shared Function CallMeIshmal() as string

Return "Call Me Ishaml"

End Function

Any other functions or subs must also be declared as Shared or Static.

You also need to either add the compiled dll to the GAC or copy it to the reportserver and reportbuilder directories.

You may also need to modify the reportserver.config file for permissions.

this link:

http://support.microsoft.com/default.aspx/pwebcst

has a list of webcasts, the first one is about using custom assemblies in SSRS>

Daryl

Manipulating a text box in custom code.

Hi there,

A simple question I hope. I have got a textbox on a report and I'm trying to populate it by calling a custom assembly. I know I can reference it directly in the textbox (this works) but I am trying to do this from the code block. The following code didn't work:

Protected Overrides Sub OnInit()
ReportItems!textbox2.Value = POCCustomAssembly.CustAssembly.Hello()
End Sub

The TextBox is called textbox2 and the custom assembly simply returns a string.

I get an error message "The is an error on line 1 of custom code: [BC30469] Reference to a non-shared member requires an object reference".

What am I doing wrong?

Hi,

I know you submitted this months ago...but I was wondering if you found the solution to your problem? I essentially am trying to do the exact same thing and can't figure out the error. I would appreciate any help.

|||

The error message you're getting suggests that the code wouldn't even work in the textbox value property, although the message could be wrong and misleading.

Is the method you have in your assembly "Shared" (VB) or "static" (c#)?

If not, try to make it shared/static. If that's not possible to do,

you can add objects to the report in Report > Report Properties > References > Classes

add the class name and your desired instance name for the object. Then you can use this instance name in your custom code.

|||

Thank you for the responose. Here is my code:

I basically wrote an assembly to calculate percentages and handle situations to divide by zero.

namespace Calculations

{

public class calcPercentage

{

public decimal Percentage(decimal decValueOne, decimal decValueTwo)

{

decimal decPercentage = 0;

if (decValueOne == 0 || decValueTwo == 0)

{

decPercentage = 0;

}

else

{

decPercentage = (decValueOne - decValueTwo) / decValueOne;

}

return decPercentage;

}

}

}

Then in my textbox I put:

=Calculations.CalcPercentage.Percentage(SUM(Fields!PreviousYTDExpenseAmount.Value, "Template_OutputData_Sales"), SUM(Fields!PreviousYTDExpenseAmount.Value, "Template_OutputData_CGS"))

I referenced the assembly and added it to C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies and I still get that error message so I do not know what the problem is.

Then after carefully reading your response, I realized I didn't write "static" in my method even though that's what I meant it to be. Now the program builds successfully but when I run it and try to produce the PDF file it catches on error when it tries to render it as a PDF. Now to figure out that error...which I will save for tomorrow....I must have screwed something up in the process.

Thanks so much for you help! If you have any suggestions about my next error...i'm all ears!

|||Also, when I removed the assembly from my report and reran it they worked fine...so if you have any suggestions let me know.|||

I cannot get the report to render to design mode while using a custom assembly. As soon as I remove the assembly, it works just fine. can anyone suggest what might be the problem? All my code is listed above and what steps I have already taken.

Thanks!

|||

Any custom assemblies used for SSRS must be declared SHARED for VB or STATIC for C#.

So for instance:

vb sample:

Public Class Class1

Public Shared Function CallMeIshmal() as string

Return "Call Me Ishaml"

End Function

Any other functions or subs must also be declared as Shared or Static.

You also need to either add the compiled dll to the GAC or copy it to the reportserver and reportbuilder directories.

You may also need to modify the reportserver.config file for permissions.

this link:

http://support.microsoft.com/default.aspx/pwebcst

has a list of webcasts, the first one is about using custom assemblies in SSRS>

Daryl