Thursday, March 22, 2012
A way to add .Net classes in a report?
I have a project with a .vb class, that, when accessing a web page, based on
the user's login, I grab their Employee ID. With that, I can conceivably
create a method to get a list of employees who report to that person
Is there a way to include a .vb class in a report project, and then, access
a particular method (in this case, getting the list of direct reports), in
the document map?Elmo,
I have done something similar. You should be able to create a reportviewer
in an aspx page and access your class in the aspx code...pass the subsequent
values to the report.
billN
--
Message posted via http://www.sqlmonster.com|||Will I be able to use the same report file (.rdl) that I designed in a
Report Server Project in BI?
I tried adding a .rdl file to a ReportViewer control one time, and it wasn't
recognized.
"wnichols via SQLMonster.com" <u3357@.uwe> wrote in message
news:7e587ee1771a4@.uwe...
> Elmo,
> I have done something similar. You should be able to create a
> reportviewer
> in an aspx page and access your class in the aspx code...pass the
> subsequent
> values to the report.
> billN
> --
> Message posted via http://www.sqlmonster.com
>
Tuesday, March 20, 2012
A tough nut to crack
I have a class C# which dynamically generates the SQL to create a stored procedure, one of the parameters i write into to the SQL is @.Keyname, and i use it in the following way
WHERE @.KeyName = CONVERT(VARCHAR, @.KeyValue)
However when i run the generated SQL to actually create the stored proc is is created with the line exactly as it is above. I need to be able to take the keyname as specified when the proc is called, which is a quoted string (i.e 'keynamefield' and write it into the SQL as keynamefield without quotes to make the field lookup dynamic based on this keyname field.
I am presuming that i will need to use function against the keyname variable inside the stored procedure (as this cannot be called from C#) something like GetValue(@.KeyName)
??
Any Ideas would be greatly appreciated
You need to use dynamic SQL but that is not what you want to do. You should not write applications that passes column names and table names dynamically for manipulation. There are lot of security risks, performance issues among other things. Best is to create the SP in such a manner that you don't need dynamic SQL. There are many ways to do this. The link below discusses the techniques to do something like this:
http://www.sommarskog.se/dyn-search.html
|||As Umachandar said, its highly risk to create a object from your code. Your database is widly open to any one. Security Issues..
Comming to your issue, you have to use NVARCHAR instead of VARCHAR for unicode characters(non-english alphabets).
|||Got it sussed thanks, the procs use the sql in a pre-generated fashion (i.e the compiler calculates the select and then it is added to a stored proc and which sql is executed is controlled by paremeters.) The procs are also encrypted so no one can execute any code they fancy on the database. I wonder though, can you encrypt tables the same way toy can procedures (i.e. WITH ENCRYPTION)?
Thanks
|||No. You can't encrypt the table definitions.Friday, February 24, 2012
A question about group structure?
I have one report like this:
Students Scores For Class 1
StudentID StudentName Age Score......
......
Average:......
Students Scores For Class 2
StudentID StudentName Age Score......
......
Average:......
...
For this report, I need to show StudentID StudentName..... on every
page as header, but Students Scores For Class only show once for each
class.
So, in this case, the structure would be:
GroupHeader --> Students Scores For Class 2
--> StudentID StudentName Age Score......
TableDetail ......
GroupFooter -- >Average:......
What would the StudentID, StudentName.... be in order to show it on
each page? Do I need to create one more group?
Thanks.Hi, Nick
When you go to 'Edit Group..." have you select 'Repeat group header on each
page'?
"Nick" <nick_1394@.yahoo.com.cn> wrote in message
news:1137454724.899667.184760@.g49g2000cwa.googlegroups.com...
> hi, all
> I have one report like this:
> Students Scores For Class 1
> StudentID StudentName Age Score......
> ......
> Average:......
> Students Scores For Class 2
> StudentID StudentName Age Score......
> ......
> Average:......
> ...
>
> For this report, I need to show StudentID StudentName..... on every
> page as header, but Students Scores For Class only show once for each
> class.
> So, in this case, the structure would be:
> GroupHeader --> Students Scores For Class 2
> --> StudentID StudentName Age Score......
> TableDetail ......
> GroupFooter -- >Average:......
> What would the StudentID, StudentName.... be in order to show it on
> each page? Do I need to create one more group?
> Thanks.
>|||hi, thanks for your reply.
I think if I select the repeat header, it will repeat "Students Scores
For Class 2" too on each page, right? I only want to repeat "StudentID,
StudentName... " this header on each page. The "Students Scores For
Class 2" is above this header, and I only want it to display once in
the whole report.|||Nick,
I'm not sure of the syntax (I'm a SQL guy, not VB) but it seems like
you need to set the visibilty property for your first group heading
line to be False (i.e. Hidden = False) only when then value in your
group field changes. I know this is pretty vague and incomplete but
maybe somebody better in VB can pick it up from here...