Showing posts with label properties. Show all posts
Showing posts with label properties. Show all posts

Monday, March 26, 2012

Generic way to style reports (CSS Style)

I want to make a CSS Style solution for my reports. I have few ideas related to this, changing the report properties on the fly, but I am not sure for which I should go for.

- We know that we can put expression on reports almost everywhere, and can also call custom code for setting up those expressions. i.e.

Public Shared Function GetValue(ByVal Key As String) As String

Dim myDataReader As SqlDataReader
Dim mySqlConnection As SqlConnection
Dim mySqlCommand As SqlCommand

mySqlConnection = New SqlConnection("server=localhost;Trusted_Connection=yes;database=tempMIQB")
mySqlCommand = New SqlCommand("SELECT * FROM [Properties] Where PropertyName='" & Key & "'", mySqlConnection)
mySqlConnection.Open()
myDataReader = mySqlCommand.ExecuteReader(CommandBehavior.CloseConnection)

If myDataReader.Read() Then
GetValue = myDataReader.Item("PropertyValue").ToString
Else
GetValue = "None"
End If

End Function

and in textbox or any where I can say =Code.GetValue("BGColor") or from .NET dll.

For going further on with this idea I can create an .NET dll and get the list from database or XML file. (Please give suggestions for performance/scalability issue.)

- second idea is to write a custom application (script) which can go through all the reports and change the color and fonts and every thing.

- third is to use parameters and use Array.IndexOf method to search for the value, but in this case i need to add dataset to all reports and, I think we cannot access report properties i.e. Parameters from custom code, just to make a generic function to access parameter value.

Hi Noordin,

I'm also trying to do this. Could you give me some leads as to how you accomplished it in the end?

Thanks,
Phil

Generic way to style reports (CSS Style)

I want to make a CSS Style solution for my reports. I have few ideas related to this, changing the report properties on the fly, but I am not sure for which I should go for.

- We know that we can put expression on reports almost everywhere, and can also call custom code for setting up those expressions. i.e.

PublicSharedFunction GetValue(ByVal Key AsString) AsString

Dim myDataReader As SqlDataReader
Dim mySqlConnection As SqlConnection
Dim mySqlCommand As SqlCommand

mySqlConnection = New SqlConnection("server=localhost;Trusted_Connection=yes;database=tempMIQB")
mySqlCommand = New SqlCommand("SELECT * FROM [Properties] Where PropertyName='" & Key & "'", mySqlConnection)
mySqlConnection.Open()
myDataReader = mySqlCommand.ExecuteReader(CommandBehavior.CloseConnection)

If myDataReader.Read() Then
GetValue = myDataReader.Item("PropertyValue").ToString
Else
GetValue = "None"
EndIf

EndFunction

and in textbox or any where I can say =Code.GetValue("BGColor") or from .NET dll.

For going further on with this idea I can create an .NET dll and get the list from database or XML file. (Please give suggestions for performance/scalability issue.)

- second idea is to write a custom application (script) which can go through all the reports and change the color and fonts and every thing.

- third is to use parameters and use Array.IndexOf method to search for the value, but in this case i need to add dataset to all reports and, I think we cannot access report properties i.e. Parameters from custom code, just to make a generic function to access parameter value.

Hi Noordin,

I'm also trying to do this. Could you give me some leads as to how you accomplished it in the end?

Thanks,
Phil

Wednesday, March 7, 2012

generate sp using wizards - have problem

When I change some tables dbowner (design table > table and index properties > owner) I can’t generate sp using wizards (tools > wizards > database > create stored procedures wizards). What is the problem? (User dbo haven’t any problem)

Which application are you using for that ?

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

Tharindu Dhaneenja wrote:

When I change some tables dbowner (design table > table and index properties > owner) I can’t generate sp using wizards (tools > wizards > database > create stored procedures wizards). What is the problem? (User dbo haven’t any problem)

does the user have the right to script? i mean permission wise?

|||

I am using sql server 2000. Manually I can write sp using my table

Eg : select EmpNo, EmpName from tharindu.emp (0 errors)

Sp name: tharindu.insertEmp_sp (after exec 0 errors (normal insert update sp))

My problem is I can’t create sp (insert record sp) using wizards.

|||

hi,

\which wizard are you referring to?

if it is the dot.net wizard, you need a primary key on the table

or you should be using the required data provider in the connection string

thanks

joey

|||

Run sql server enterprise manager > tools > wizards > database > create stored procedures wizards.

|||

could it be permission problem.

check if you have rights to create proc in the Db

|||

Yes I have rights to create proc in the Db, for example after login SQL query analyzer using my user (“Tharindu”) I can create, delete all sp and tables. But only problem is I can’t create sp using wizards.

This error prompt,

http://tharindu.50webs.com/err/error.htm

|||

Finally I see my error jpg doesn’t open.

Still can not find good solution I think sql server wizards support only user “dbo”

|||

More information about this matter read this, Generate sp using wizards display flowing Error…(Error 21776)

generate sp using wizards - have problem

When I change some tables dbowner (design table > table and index properties > owner) I can’t generate sp using wizards (tools > wizards > database > create stored procedures wizards). What is the problem? (User dbo haven’t any problem)

Which application are you using for that ?

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

Tharindu Dhaneenja wrote:

When I change some tables dbowner (design table > table and index properties > owner) I can’t generate sp using wizards (tools > wizards > database > create stored procedures wizards). What is the problem? (User dbo haven’t any problem)

does the user have the right to script? i mean permission wise?

|||

I am using sql server 2000. Manually I can write sp using my table

Eg : select EmpNo, EmpName from tharindu.emp (0 errors)

Sp name: tharindu.insertEmp_sp (after exec 0 errors (normal insert update sp))

My problem is I can’t create sp (insert record sp) using wizards.

|||

hi,

\which wizard are you referring to?

if it is the dot.net wizard, you need a primary key on the table

or you should be using the required data provider in the connection string

thanks

joey

|||

Run sql server enterprise manager > tools > wizards > database > create stored procedures wizards.

|||

could it be permission problem.

check if you have rights to create proc in the Db

|||

Yes I have rights to create proc in the Db, for example after login SQL query analyzer using my user (“Tharindu”) I can create, delete all sp and tables. But only problem is I can’t create sp using wizards.

This error prompt,

http://tharindu.50webs.com/err/error.htm

|||

Finally I see my error jpg doesn’t open.

Still can not find good solution I think sql server wizards support only user “dbo”

|||

More information about this matter read this, Generate sp using wizards display flowing Error…(Error 21776)