Showing posts with label field. Show all posts
Showing posts with label field. Show all posts

Wednesday, March 28, 2012

Intermittent field display

This is either a bug, or I am crazy.

I have developed a report that pulls its data from an SSAS cube. The report is grouped on Fields!FacilityName. On each "page" of the report, I have information for the displayed facility.

At the top of each page in my report I have a textbox whose value is =Fields!FacilityName. Further down on the report I have another text box whose value is set exactly the same. When I preview the report, I always have a value in the upper box, but only sometimes have a value in the lower box. If I change the value in the lower box to just a text string, it will always display, but when I put in the actual field reference it does not. It always doesn't display for the same facility names. Remember, the upper textbox on the form always displays 100% of the time.

I have a Dundas chart in the middle of the page on the report between these textboxes, but another field that pulls parameters and even a matrix all render correctly below that chart.

They both have the same parent according to the properties. I have even copied and pasted the working textbox further down the screen, with no improvement. When I changed the value of the textbox to "=cstr(len(Fields!FacilityName))", on the pages when it wants to be blank, it reads 0, and on other pages it shows a larger number. But the other textbox on the screen will always properly show the FacilityName.

I have also tried changing the name of the textbox, settings output to YES instead of Auto. If I slide the non-working textbox up to the top of the page and the working textbox down to the bottom area of the page, the bevavior switches.

Does anybody know of rendering issues with textboxes showing the same infomation?

Are you running at least SSRS2005 SP1 (on the server and for BI Dev.Studio)?

-- Robert

|||My server is running Microsoft SQL Server Reporting Services Version 9.00.2047.00, and I am using VS 2005 with the most recent service pack on my development PC. Both exibit the behavior I describe.
Could it be something odd in the XML of the report that I just cannot see in the IDE?
|||We are running 9.00.2047.00 on the server, and my VS 2005 is up to date. Maybe there is something buried in the XML of the RDL that I just cannot see in the IDE that is causing the problem.|||I also have a ticket in with Dundas since when I remove the chart off the report, the textbox renders correctly. Perhaps the chart is breaking the recordset in some way.

Wednesday, March 21, 2012

Interesting Problem

Imagine a table in Microsoft Sql Server 2000 named Pictures with three
fields. A primary key ID(int), a Name(nvarchar) and a Picture(image)
field.

Lets put some records into the table. The first two fields as expected
would take an int and a string. The third field is of type image.
Instead of putting a bitmap in this field lets place an xml document
that has been streamed into a byte array. The xml document would
describe the Picture using say lines. If the picture was that of a
square we would have four lines in the xml document. You could think of
the xml document as something similar to vector graphics but the
details are not relevant. The important fact is that the contents of
the image field is NOT a bitmap but a binary stream of an xml document.

Now imagine we have a reporting tool like Crystal Reports that can be
used to report on this database table. Imagine we create a report by
using the three fields mentioned above. As far as Crystal is concerned
the first field is an int, the second a string and the third an image.
If our table had ten records and we preview the report we like to see
10 entries each consisting of an ID, Name and a Picture.

This can only happen if the image field contains a Bitmap, but as
mentioned above the field contains an xml document.

Now my question...

Can we write something in SQL Server 2000 (not 2005) to sit between the
table and Crystal Reports so to convert the XML document to a bitmap.
The restriction is that we cannot use anything but sql server itself.
The client in the above case has been Crystal Reports but it could be
anything.

I know SQL Server 2005 supports C# with access to the .NET framework
within the database. Unfortunately, I am not using SQL server 2005.

Some people have suggested the use of User Defined Functions and TSQL.
I like to know from the more experienced SQL Server people if what I am
trying to achieve is possible. Maybe it has not been done but is it
possible?

Any suggestions would be greatly appreciated...

Many RegardsTranslating an XML byte stream to a bitmap dynamically sounds like
something which is probably beyond pure TSQL. Even if it is possible
somehow, I suspect that the code would be complex and slow - TSQL isn't
really a general purpose language, and its support for manipulating
binary data is limited.

Having said that, there are a couple of ways you might be able to
approach this - extended stored procedures, and COM support. An
extended proc is an external DLL which can be called from TSQL, rather
like a more basic version of the .NET support in 2005. Alternatively,
you can use the sp_OA% procs to instantiate COM objects, so if your
logic can be written as a COM object, then you can use it from TSQL.
Check Books Online for more details on both these options.

Although I don't have much experience with extended procs, the COM
support is probably not a good solution, because of security and
performance issues. The best approach is almost certainly to do this in
client code, rather than the database - perhaps you can look at
embedding something in Crystal, instead of in the database?

Simon|||Perhaps it would be possible to write an extended stored proc and call
that from a function. That of course assumes that Crystal Reports
provides some method of rendering a bitmap returned from a query.

I can't think of a good reason to do this in SQL Server. It's obviously
better suited for the client or middle-tier.

--
David Portas
SQL Server MVP
--|||Hi Simon

Thanks for your suggestions. I think I like the Extented Stored
Procedure(xp) route more and I can certainly create a dll in C++ to
convert an XML document containing the description of the square to a
bitmap of the square (say 100x100 pixels by default). Once I add this
xp to sql server I need to attach it to my xml field in some way so
that when Crystal requests the content of the image field in the
Pictures table instead of it returning the binary array representing
the xml document it returns the on-the-fly generated bitmap.

Is there a way I could intervene in what sql sends to crystal in
respect to the Picture field using the xp? Do I need to use triggers?
Basically I am trying to fool crystal that the Picture field contains a
Bitmap. This needs to happen when the Crystal does a select I
suppose...

Probably its worth mentioning why I am trying to do this at all...

We have a drawing package that allows users to draw shapes. We can
store these as an XML document and restore them. Whats more we have a
control that can render these documents directly. Thus in order to
preview the XML document all that is needed is the control which is
self contained. The control also scales the preview of the shape.

We therefore can store the XML for this document in the database and
not worry about also storing a preview bitmap of the shape in the same
row. This means there is less danger of the preview bitmap field going
out of syn with the xml document and also avoids data redundancy. Whats
more preview bitmaps are fixed in size and dont scale well. This
approach solves all these problems.

However, as databases are often reported on and that Crystal Reports is
a leading reporting tool I like our database to work well with Crystal
when wanting to create reports that need the picture field (that
contains the xml document).

This is exactly why I need to the conversion at SQL as our customers
could do reporting directly from the database using Crystal Reports.
Embedding within Crystal is also not an option as the reporting tool
could change.

Many Thanks in Advance|||Thanks Dave

Please look at my reply to Simon for reasons why I am trying to do
this...
Problem now is how to fool Crystal to get the Bitmap from the xp as
oppose the xml from the field...

Any comments would be appreciated...

Regards..|||> Is there a way I could intervene in what sql sends to crystal in
> respect to the Picture field using the xp? Do I need to use triggers?

You could call your XP from a user-defined function and return the
result as a binary column. Put the UDF in a view and query the view
from Crystal. There are no triggers on SELECT so this is the only
method I can think of.

--
David Portas
SQL Server MVP
--

Monday, March 19, 2012

Interesting Average problem

I have a table that has a numeric field and the footer of the field has to
display the AVG of the field.
Some of the field values are null, and those should be left out of the
calculation.
Doing a AVG(Field!Name.Value) of course take them into account as well.
Any ideas?
Thanks.Shrink, shrink, shrink, in the end it works if the field is null, different
story if it is zero.
"Chris Botha" <chris_s_botha@.AT_h.o.t.m.a.i.l.com> wrote in message
news:ujqmWjUZEHA.1480@.TK2MSFTNGP10.phx.gbl...
> I have a table that has a numeric field and the footer of the field has to
> display the AVG of the field.
> Some of the field values are null, and those should be left out of the
> calculation.
> Doing a AVG(Field!Name.Value) of course take them into account as well.
> Any ideas?
> Thanks.
>

Monday, March 12, 2012

Interactive Sort on Drillthrough reports

I have an issue with the use of interactive sorts on a table that has a field with a drill through to a different report.

When the report is unsorted it opens up the link to the new report as expected, however when interactive sort is applied the drill through report opens up on the parent report and the page loads a warning error

"can't execute code from freed script"

Has anyone seen this?

Ify

Conchango

Hello,

I have the same problem :

ASPX page + Report Viewer + Report with DrillDown and Jump to URL.

If the ReportViewer property AsyncRendering is set to true, after drilldown i have this message in IE (6) :

"can't execute code from freed script"

The problem is on this line (Reserved.Reportviewer.xad) :

function OnReportFrameLoaded()

{

this.m_reportLoaded = true;

this.ShowWaitFrame(false);

if (this.IsAsync && this.m_reportObject != null)

this.m_reportObject.OnFrameVisible();

If the ReportViewer property AsyncRendering is set to false, i don't have the problem (but my report is not "usable")

I don't know if it's an IE problem or a ReportViewer problem ?

Frederic

|||

I am also having the same error. Any help will be appreciated.

thanks,

Mini

Interactive Sort on Drillthrough reports

I have an issue with the use of interactive sorts on a table that has a field with a drill through to a different report.

When the report is unsorted it opens up the link to the new report as expected, however when interactive sort is applied the drill through report opens up on the parent report and the page loads a warning error

"can't execute code from freed script"

Has anyone seen this?

Ify

Conchango

Hello,

I have the same problem :

ASPX page + Report Viewer + Report with DrillDown and Jump to URL.

If the ReportViewer property AsyncRendering is set to true, after drilldown i have this message in IE (6) :

"can't execute code from freed script"

The problem is on this line (Reserved.Reportviewer.xad) :

function OnReportFrameLoaded()

{

this.m_reportLoaded = true;

this.ShowWaitFrame(false);

if (this.IsAsync && this.m_reportObject != null)

this.m_reportObject.OnFrameVisible();

If the ReportViewer property AsyncRendering is set to false, i don't have the problem (but my report is not "usable")

I don't know if it's an IE problem or a ReportViewer problem ?

Frederic

|||

I am also having the same error. Any help will be appreciated.

thanks,

Mini

Interactive Sort on date field

I have an RS 2005 June CTP report where the data source is an MDX query against AS 2005 June CTP. I'm using Interactive Sort on several columns and it's working fine for the numeric and string fields, but it's sorting the date columns alphabetically instead of chronologically. Is there a way I can specify that these fields are date fields and should be sorted chronologically?
Thanks,
Dirk

Most likely the date field is returned as string through the provider. Try to explicitly convert it with the CDate(...) function in the sort expression. E.g. =CDate(Fields!OrderDate.Value)
-- Robert

|||That did the trick, thanks for the help.|||

I'm also using Interactive Sort on several columns in MSRS 2005,
my problem is with sorting the currency columns (columns with $ sign) - it doesn't work, dallor ammounts are not sorted in accending/decending order. Is there a way I can specify that these fields be sorted as numbers?

Thanks!

|||

It sounds like you are sorting on strings (because the underlying dataset field contains a string rather than a numeric value).

You should sort on a numeric value of the dollar amount - e.g. by changing the dataset query to return the numeric value instead of the string. You can then still apply the currency formatting in the report by using the Format property on textboxes and set it to e.g. C0 (for currency formatting with zero decimals)

-- Robert

Interactive Sort on date field

I have an RS 2005 June CTP report where the data source is an MDX query against AS 2005 June CTP. I'm using Interactive Sort on several columns and it's working fine for the numeric and string fields, but it's sorting the date columns alphabetically instead of chronologically. Is there a way I can specify that these fields are date fields and should be sorted chronologically?
Thanks,
Dirk

Most likely the date field is returned as string through the provider. Try to explicitly convert it with the CDate(...) function in the sort expression. E.g. =CDate(Fields!OrderDate.Value)
-- Robert

|||That did the trick, thanks for the help.|||

I'm also using Interactive Sort on several columns in MSRS 2005,
my problem is with sorting the currency columns (columns with $ sign) - it doesn't work, dallor ammounts are not sorted in accending/decending order. Is there a way I can specify that these fields be sorted as numbers?

Thanks!

|||

It sounds like you are sorting on strings (because the underlying dataset field contains a string rather than a numeric value).

You should sort on a numeric value of the dollar amount - e.g. by changing the dataset query to return the numeric value instead of the string. You can then still apply the currency formatting in the report by using the Format property on textboxes and set it to e.g. C0 (for currency formatting with zero decimals)

-- Robert

Interactive sort changes time field values to 0

Hello all, I have a report which connects to a Pervasive database via an ODBC connection on the reporting server (RS2005). When I initially bring the report up, a time field (OdbcType.Time) shows the correct format: hh:mm:ss. When I sort any of the sortable columns on the report, the time field (which is not sortable) values all change to 0. Backing out of the report and re-running it restores the correct time values. Any ideas?
Thanks, KenThis issue could be related to the data type of the field. There is a fixed set of data types RS supports: string, boolean, numeric, datetime, timespan. When you sort, we have to use the data we temporarily store (so that we don't have to query the data source) to process the report. If it's not one of the types supported, it might cause the loss of the value. Can you check what CLR type the time field is of?|||Hi Fang, Please forgive my ignorance, but I'm not sure what the 'clr' type is. VS2005 says the table field type is OdbcType.Time. If I try to convert it to something silly, VS2005 complains that type 'TimeSpan' cannot be converted to the silly type. So I guess the CLR type is TimeSpan?|||Can you check your RDL file? Look under the <Field> element of that field, what's the value for <rd:TypeName>?|||Thanks for your time Fang, I've pasted the snippet for the field in question:
<Field Name="TIME_RECEIVED">
<rd:TypeName>System.TimeSpan</rd:TypeName>
<DataField>TIME_RECEIVED</DataField>
</Field>|||Hmm, we have not seen this problem before. Can you submit it along with your .rdl and .rdl.data files at https://connect.microsoft.com/SQLServer? We'll investigate it. Thanks.|||Thank you Fang. I have submitted a bug report and uploaded the files.|||Thanks. We have investigated the issue and the fix will hopefully be included in the next service pack.

Interactive sort changes time field values to 0

Hello all, I have a report which connects to a Pervasive database via an ODBC connection on the reporting server (RS2005). When I initially bring the report up, a time field (OdbcType.Time) shows the correct format: hh:mm:ss. When I sort any of the sortable columns on the report, the time field (which is not sortable) values all change to 0. Backing out of the report and re-running it restores the correct time values. Any ideas?
Thanks, KenThis issue could be related to the data type of the field. There is a fixed set of data types RS supports: string, boolean, numeric, datetime, timespan. When you sort, we have to use the data we temporarily store (so that we don't have to query the data source) to process the report. If it's not one of the types supported, it might cause the loss of the value. Can you check what CLR type the time field is of?|||Hi Fang, Please forgive my ignorance, but I'm not sure what the 'clr' type is. VS2005 says the table field type is OdbcType.Time. If I try to convert it to something silly, VS2005 complains that type 'TimeSpan' cannot be converted to the silly type. So I guess the CLR type is TimeSpan?|||Can you check your RDL file? Look under the <Field> element of that field, what's the value for <rd:TypeName>?|||Thanks for your time Fang, I've pasted the snippet for the field in question:
<Field Name="TIME_RECEIVED">
<rd:TypeName>System.TimeSpan</rd:TypeName>
<DataField>TIME_RECEIVED</DataField>
</Field>|||Hmm, we have not seen this problem before. Can you submit it along with your .rdl and .rdl.data files at https://connect.microsoft.com/SQLServer? We'll investigate it. Thanks.|||Thank you Fang. I have submitted a bug report and uploaded the files.|||Thanks. We have investigated the issue and the fix will hopefully be included in the next service pack.