Tuesday, March 20, 2012

Asterix not showing in report details

I have a report that shows a header, details and a footer

The detail line never prints lines with asterixes in them, e.g.

"**blah blah**"

As soon as I delete the asterix from the database, the line appears on the report

Any ideas anyone?

to clarify

are you saying:

you have a value in the database that contains the text "** blah blah **"

when you run the report, only "blah blah" is rendered in the row and not "** blah blah **"

?|||

It does not print the line at all, also additionally the problem seems to be caused only by the asterix at the start of the line

so when I would expect the report to show:

Header

detail1

detail2

*blah blah

detai*l4

Footer

The report actually omits the line "*blah blah" and prints this instead:

Header

detail1

detail2

detai*l4

Footer

|||

Interesting... but I am not able to repro this in a simple case (ie an expression such as ="****" prints fine).

So here are some questions:

* -- does the disappearing line occur in all output targets? Or only some (such as HTML versus Excel)?

* -- what does the expression for your detail column look like?

>L<

|||

To reproduce this you will have to query an sql database

The detail row of the table contains:

=Last(Fields!Case_SolutionNote.Value)

|||

no, I still can't repro it. I tried a simple version (without the Last) and also one with a Last() function. I could see it fine.

What else do I have to know about your Case_SolutionNote field? What type is it? How long are the typical values? Can you post some example values (with and without * character)?

>L<

|||

Interestingly, I also get a problem with the report's group footer section, it sometimes does not print at all either, I have not worked out why yet, but I suspect it is the presence of non alphanumeric characters in the relevant database field (which is an ntext data type)

I copied the contents of the field to notepad, deleted the contents of the field from the database, then used the 'update' statement (due to bug that prevents editing of ntext cells sometimes in microsoft sql server management studio) to repopulate it with a copy of the original text from notepad, it then shows on the report

I think there is a weakness somewhere in ntext data types in sql or reporting services relating to non alphanumeric characters

|||

Oh, also...

When I delete the report's group header/footer, leaving just a basic report with detail lines, the original problem dissappears - lines with asterixes at the beginning of them appear!!

ie the report prints correctly, e.g:

detail1

detail2

*blah blah

detai*l4

also...

if i have a group header/footer present, the group footer will print lines starting with asterixes but the detail lines do not

|||

When you copy the value of the field to Notepad and back, and then using the UPDATE statement you may not be preserving the Unicode characteristics of the string. It's hard to tell, because the clipboard buffer, the way you've stated the UPDATE, and the way the interactive query-handling facility in Studio would all be involved in interpreting that data <s>.

Point is, it is not a fair test...

>L<

|||

I wish I could be absolutely sure that your report logic isn't doing something to influence is -- forgive me, I don't mean to doubt you -- it's just that you have the Last() function in there....

IOW, I can't tell whether the lines you're expecting are missing because of what you've pinpointed (the asterisk) or some other factor, such as the sort/group/whatever changing what Last() decides should come up.

Without repro'ing more of your exact scenario I can't debug, reproduce your error.. or otherwise offer advice... sorry

>L<

|||

Hi thanks for you help Smile

Regarding the second problem where the group footer was not displaying sometimes, I have worked around this by adding a space to the beginning of the data on the fly in the select statement in the report - note this only works in testing on sql server 2005 (unfortunately varchar(max) does not work in sql server 2000 where my database lives! Sad )

ie i changed this:

select....., CaseProgress.Case_SolutionNote, .......

to

select....., (cast(' ' as varchar(max)) + cast(CaseProgress.Case_SolutionNote as varchar(max))) as Case_SolutionNote, .......

What this does is to populate the field if it was null in any rows - bear in mind i am using Last!(CaseProgress.Case_SolutionNote) and the last row is usually not empty but was not printing if prior rows had a 'null' in the field - wierd

The original problem with the aterix still stands

My hunch about alphanumeric characters was a red-herring i think

|||

Actually a slightly better workaround for the second problem is:

select..,isnull(CaseProgress.Case_SolutionNote,' ') Case_SolutionNote,...

|||

>>The original problem with the aterix still stands

Unfortunately I think I can't go any further to help without being able to repro.

I created a table with an ntext column. I replaced the data in each even-numbered row with "*" + the data. I used the Last() function. I tried it on a details level and a group level. Still worked.

I'd be willing to look at your report, if you thought it would do any good... but I still think it may be something data related, even though I don't know why or how...

>> My hunch about alphanumeric characters was a red-herring i think

Yes, I'm sure of that...

>L<

|||

Fixed:

The filter on the detail line of the report was causing the problem, I changed the filter on the detail line to this:

=len(trim(Fields!Case_ProgressNote.Value)) > =0

(i.e. ignore blank entries)

note Case_ProgressNote.Value is ntext in the database, but by the time it gets to the layout it has been converted to text (the fact that it was ntext is irrelevant at this point)

sql

No comments:

Post a Comment