Showing posts with label dynamicly. Show all posts
Showing posts with label dynamicly. Show all posts

Wednesday, March 21, 2012

Dynamicly setting events

I have the following code and I'm trying to set an event dynamicly in the foreach statement...

SqlConnection

conn =newSqlConnection(ConfigurationManager.AppSettings["BvtQueueConnectString2"]);SqlCommand select =newSqlCommand("select top 100 b.jobid as [Job ID], bq.timesubmitted as [Time Submitted], b.timereceived as [Time Received], bq.requestid as [Request ID], bq.timecompleted as [Time Completed], bq.buginfoid as [Bug Info ID], e.eventid as [Event ID], bq.closingeventid as [Closing Event ID], et.eventtype as [Event Type], e.eventtime as [State Start Time], l.twolettercode as [Language], p.projectname as [Project Name], p.packagedesignation as [Package Designation] from bvtjobs b inner join bvtrequestsnew bq on b.jobid = bq.jobid inner join eventlog e on bq.requestid = e.bvtrequestid inner join eventtypes et on e.eventtype = et.eventtypeid inner join languages l on bq.targetlanguage = l.langid inner join projects p on bq.targetplatform = p.projectid order by b.jobid asc", conn);SqlDataAdapter da =newSqlDataAdapter(select);DataSet ds =newDataSet();

conn.Open();

da.Fill(ds);

conn.Close();

Table table =newTable();

foreach (DataRow drin ds.Tables[0].Rows)

{

TableRow tr =newTableRow();for (int i = 0; i < dr.ItemArray.Length; i++)

{

TableCell tc =newTableCell();

tc.Text = dr.ItemArray.GetValue(i).ToString();

tc.BackColor =

Color.White;if (dr.ItemArray.GetValue(8).ToString() =="COMPLETE")

{

tc.BackColor =

Color.BlueViolet;

}

tr.Cells.Add(tc);

}

table.Rows.Add(tr);

}

foreach (TableRow tablerowin table.Rows)

{

TableCell newtc =newTableCell();Button mybutton =newButton();

newtc.Controls.Add(mybutton);

mybutton.Text =

"details";

//set the event here

tablerow.Cells.Add(newtc);

}

Panel1.Controls.Add(table);

DataBind();

I am assuming you have added a button dynamically, and you want to create a handler for this button.

First you need to create a function to do what you want, e.g.

Sub myButtonClicked (sender, args)

....

End sub

Then you need to tell asp.net that this is the function to run when the button is clicked. In your code, before you add the button to the tablecell, write:

AddHandler myButton.click, AddressOg myButtonClicked

A little warning though - this may not work. This is because you have to create any dynamic controls everytime the page load. Have a read ofthis page which should help you.

|||

thanks for the response.

The solution that I have found is to add the eventhandler and specify what you want to do init. In this case redirect towww.google.com :

protected

void Page_Load(object sender,EventArgs e)

{

SqlConnection conn =newSqlConnection(ConfigurationManager.AppSettings["BvtQueueConnectString2"]);SqlCommand select =newSqlCommand("select top 100 b.jobid as [Job ID], bq.timesubmitted as [Time Submitted], b.timereceived as [Time Received], bq.requestid as [Request ID], bq.timecompleted as [Time Completed], bq.buginfoid as [Bug Info ID], e.eventid as [Event ID], bq.closingeventid as [Closing Event ID], et.eventtype as [Event Type], e.eventtime as [State Start Time], l.twolettercode as [Language], p.projectname as [Project Name], p.packagedesignation as [Package Designation] from bvtjobs b inner join bvtrequestsnew bq on b.jobid = bq.jobid inner join eventlog e on bq.requestid = e.bvtrequestid inner join eventtypes et on e.eventtype = et.eventtypeid inner join languages l on bq.targetlanguage = l.langid inner join projects p on bq.targetplatform = p.projectid order by b.jobid asc", conn);SqlDataAdapter da =newSqlDataAdapter(select);DataSet ds =newDataSet();

conn.Open();

da.Fill(ds);

conn.Close();

Table table =newTable();

foreach (DataRow drin ds.Tables[0].Rows)

{

TableRow tr =newTableRow();for (int i = 0; i < dr.ItemArray.Length; i++)

{

TableCell tc =newTableCell();

tc.Text = dr.ItemArray.GetValue(i).ToString();

tc.BackColor =

Color.White;if (dr.ItemArray.GetValue(8).ToString() =="COMPLETE")

{

tc.BackColor =

Color.BlueViolet;

}

tr.Cells.Add(tc);

}

table.Rows.Add(tr);

}

foreach (TableRow tablerowin table.Rows)

{

TableCell newtc =newTableCell();Button mybutton =newButton();

newtc.Controls.Add(mybutton);

mybutton.Text =

"details";

mybutton.Click +=

newEventHandler(mybutton_Click);

tablerow.Cells.Add(newtc);

}

Panel1.Controls.Add(table);

DataBind();

}

void mybutton_Click(object sender,EventArgs e)

{

Response.Redirect(

"http://www.google.com");

}

Dynamicly load tables for DataSources/DataDestinations

Hi everybody,

The names of the tables that sould be transfered from the production system to the DWH are stored in a table in the production system. Yet I haven't found a proper way to dynamicly define these tables as DataSources and DataDestinations within an Integration Services project.

I hope somebody can help me. Thanks.

Is the metadata of these tables the same? If so you could loop over the list of tables using a ForEach loop and execute the same data-flow for each one of them. Reply here, search this forum or read this: http://blogs.conchango.com/jamiethomson/archive/2006/03/11/3063.aspx if you need help in doing that.

If the metadata is NOT the same then you'll need a seperate data-flow for each in which case there isn't much point in storing the name of the source tables somewhere.

If you are intent on dynamically setting the name of the table to extract from then this should help also: http://blogs.conchango.com/jamiethomson/archive/2005/12/09/2480.aspx

-Jamie

sql

Dynamicly displaying Page Header and Page Footer

I need to show or hide Page Header and Footer on the last page of a report
based on a parameter. Is there a way of doing this?
Thanks in advanceIt seems that you can't dynamically choose visibility for the header or
footer. It's either on or off. But you can control the visibility of
elements on the header and footer.
Create a footer. Set DisplayOnFirstPage and DisplayOnLastPage = Yes
Add a rectangle. Add controls to the footer inside the rectangle.
On the Visibility parameter of the rectangle, type
=IIF(Globals!PageNumber>1, False, True)
If your report stretches over 2 or more pages, you will see the content of
the rectangle on page 2 and out. You can change the expression according to
your needs, this was just a quick example.
Kaisa M. Lindahl Lervik
"Wendy" <Wendy@.discussions.microsoft.com> wrote in message
news:A80B4773-F77A-43B5-BA3C-C2662073B2FD@.microsoft.com...
>I need to show or hide Page Header and Footer on the last page of a report
> based on a parameter. Is there a way of doing this?
> Thanks in advance
>|||the same way :
From http://www.developmentnow.com
Posted via DevelopmentNow.com Group
http://www.developmentnow.com

Dynamicly create report

Hi All,
I would like to create report like below:
For example: I have a stored procedure spDeptEmp, which has a Dept ID
as input parameter, Once the Dept ID has been passed in, I will get
all the employees on that dept. The question is: I would like to
generate the report, which will display each employee's detail
information, one person per page.
Could you let me know how can I do that using reporting services?
Thanks in advance!
--BillWhat do you mean by dynamic? I don't see the report being dynamic (i.e. that
you show different columns at different times or some such thing). It seems
to me that you are just returning different data depending on the parameter
but the format/layout etc of the report is unchanged. Everything you
describe here is very vanilla report generation for RS. You can easily add
page breaks, you can easily have a query based on a parameter.
Bruce L-C
"bill" <bli2001@.hotmail.com> wrote in message
news:2a3a3975.0408250950.723ae518@.posting.google.com...
> Hi All,
> I would like to create report like below:
> For example: I have a stored procedure spDeptEmp, which has a Dept ID
> as input parameter, Once the Dept ID has been passed in, I will get
> all the employees on that dept. The question is: I would like to
> generate the report, which will display each employee's detail
> information, one person per page.
> Could you let me know how can I do that using reporting services?
> Thanks in advance!
> --Bill|||"Bruce Loehle-Conger" <bruce_lcNOSPAM@.hotmail.com> wrote in message news:<uUeQVAtiEHA.3612@.TK2MSFTNGP12.phx.gbl>...
> What do you mean by dynamic? I don't see the report being dynamic (i.e. that
> you show different columns at different times or some such thing). It seems
> to me that you are just returning different data depending on the parameter
> but the format/layout etc of the report is unchanged. Everything you
> describe here is very vanilla report generation for RS. You can easily add
> page breaks, you can easily have a query based on a parameter.
> Bruce L-C
> "bill" <bli2001@.hotmail.com> wrote in message
> news:2a3a3975.0408250950.723ae518@.posting.google.com...
> > Hi All,
> >
> > I would like to create report like below:
> > For example: I have a stored procedure spDeptEmp, which has a Dept ID
> > as input parameter, Once the Dept ID has been passed in, I will get
> > all the employees on that dept. The question is: I would like to
> > generate the report, which will display each employee's detail
> > information, one person per page.
> >
> > Could you let me know how can I do that using reporting services?
> >
> > Thanks in advance!
> >
> > --Bill
The dynamic means you don't know how many employees inside one dept.
until you get the input parameter(dept ID). Different dept. will have
different number of employees. i.e. the report will be different.
Also, for one employee's information, it will come from different
dataset.
Thanks,
--Bill|||What you are wanting to do is exactly what RS is designed to do quite
easily. If a simple matter of here is a dept, list all employee's
information with page breaks between them. That would be a single
parameterized query with appropriate grouping and page breaks. If it is more
a master detail type report then subreports will do what you want.
Bruce L-C
"bill" <bli2001@.hotmail.com> wrote in message
news:2a3a3975.0408251442.232899ab@.posting.google.com...
> "Bruce Loehle-Conger" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:<uUeQVAtiEHA.3612@.TK2MSFTNGP12.phx.gbl>...
> > What do you mean by dynamic? I don't see the report being dynamic (i.e.
that
> > you show different columns at different times or some such thing). It
seems
> > to me that you are just returning different data depending on the
parameter
> > but the format/layout etc of the report is unchanged. Everything you
> > describe here is very vanilla report generation for RS. You can easily
add
> > page breaks, you can easily have a query based on a parameter.
> >
> > Bruce L-C
> >
> > "bill" <bli2001@.hotmail.com> wrote in message
> > news:2a3a3975.0408250950.723ae518@.posting.google.com...
> > > Hi All,
> > >
> > > I would like to create report like below:
> > > For example: I have a stored procedure spDeptEmp, which has a Dept ID
> > > as input parameter, Once the Dept ID has been passed in, I will get
> > > all the employees on that dept. The question is: I would like to
> > > generate the report, which will display each employee's detail
> > > information, one person per page.
> > >
> > > Could you let me know how can I do that using reporting services?
> > >
> > > Thanks in advance!
> > >
> > > --Bill
> The dynamic means you don't know how many employees inside one dept.
> until you get the input parameter(dept ID). Different dept. will have
> different number of employees. i.e. the report will be different.
> Also, for one employee's information, it will come from different
> dataset.
> Thanks,
> --Bill

Dynamicly build report against Reporting Services

Hello Every one,
I would like to know if it's possible to dynamicly build report againt
RS ?
Thanks alots
Best Regards and seasons greetings!
Patrice Lamarche
Groupe Conseil OmnitechPossible but not that easy. Here is what you have to do today. First, you
need to learn the rdl specification (you can find that on MS site) which is
XML and create the report yourself. Then you have to deploy it using web
services. Since it is a server based solution you have to deploy it with a
unique name so that only the user you want to use it uses it. So, two things
skills you have to have for this: web services and creating the rdl on the
fly. With Yukon there will be both a winform and webform control that will
work with the server if it is there but does not require it. In theory (I
have not use it since it is not even out in beta yet) you should be able to
give it the rdl. So with Yukon you at least do not have the hoops to jump
through on deploying the report you generated.
What are you wanting to do that requires dynamically building the report. If
it is data you have the option of filtering the data based on the user.
Also, there are many many places that expressions can be used in the report
that allow a degree of dynamic changes to the report.
My advice is only go this route if you have to.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Patrice Lamarche" <Patrice_lamarche@.Removethis.gco.ca> wrote in message
news:unkvErc6EHA.4028@.TK2MSFTNGP15.phx.gbl...
> Hello Every one,
> I would like to know if it's possible to dynamicly build report againt RS
> ?
> Thanks alots
> Best Regards and seasons greetings!
> Patrice Lamarche
> Groupe Conseil Omnitech|||In addition to what Bruce said, this is how I addressed a similiar problem
in the past. The customer wanted to have a report with sections which are
shown on demand, that is the user could select which sections she wants to
see. To minimize development effort, I decideded to have a report template
which has all the sections. Then, it was just a matter of loading the report
RDL in XML DOM and removing the section elements you don't need. I addition,
I had to take care of re-positioning (moving up) the remaining sections to
fill in the emtpy space left by the deleted sections.
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:O9bMOLd6EHA.2552@.TK2MSFTNGP09.phx.gbl...
> Possible but not that easy. Here is what you have to do today. First, you
> need to learn the rdl specification (you can find that on MS site) which
> is XML and create the report yourself. Then you have to deploy it using
> web services. Since it is a server based solution you have to deploy it
> with a unique name so that only the user you want to use it uses it. So,
> two things skills you have to have for this: web services and creating the
> rdl on the fly. With Yukon there will be both a winform and webform
> control that will work with the server if it is there but does not require
> it. In theory (I have not use it since it is not even out in beta yet) you
> should be able to give it the rdl. So with Yukon you at least do not have
> the hoops to jump through on deploying the report you generated.
> What are you wanting to do that requires dynamically building the report.
> If it is data you have the option of filtering the data based on the user.
> Also, there are many many places that expressions can be used in the
> report that allow a degree of dynamic changes to the report.
> My advice is only go this route if you have to.
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
>
> "Patrice Lamarche" <Patrice_lamarche@.Removethis.gco.ca> wrote in message
> news:unkvErc6EHA.4028@.TK2MSFTNGP15.phx.gbl...
>> Hello Every one,
>> I would like to know if it's possible to dynamicly build report againt RS
>> ?
>> Thanks alots
>> Best Regards and seasons greetings!
>> Patrice Lamarche
>> Groupe Conseil Omnitech
>|||You can generate the RDL/XML on the fly using the RDL reader/writer
http://www.rdlcomponents.com
Jerry
"Teo Lachev [MVP]" wrote:
> In addition to what Bruce said, this is how I addressed a similiar problem
> in the past. The customer wanted to have a report with sections which are
> shown on demand, that is the user could select which sections she wants to
> see. To minimize development effort, I decideded to have a report template
> which has all the sections. Then, it was just a matter of loading the report
> RDL in XML DOM and removing the section elements you don't need. I addition,
> I had to take care of re-positioning (moving up) the remaining sections to
> fill in the emtpy space left by the deleted sections.
> --
> Hope this helps.
> ---
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ---
> "Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
> news:O9bMOLd6EHA.2552@.TK2MSFTNGP09.phx.gbl...
> > Possible but not that easy. Here is what you have to do today. First, you
> > need to learn the rdl specification (you can find that on MS site) which
> > is XML and create the report yourself. Then you have to deploy it using
> > web services. Since it is a server based solution you have to deploy it
> > with a unique name so that only the user you want to use it uses it. So,
> > two things skills you have to have for this: web services and creating the
> > rdl on the fly. With Yukon there will be both a winform and webform
> > control that will work with the server if it is there but does not require
> > it. In theory (I have not use it since it is not even out in beta yet) you
> > should be able to give it the rdl. So with Yukon you at least do not have
> > the hoops to jump through on deploying the report you generated.
> >
> > What are you wanting to do that requires dynamically building the report.
> > If it is data you have the option of filtering the data based on the user.
> > Also, there are many many places that expressions can be used in the
> > report that allow a degree of dynamic changes to the report.
> >
> > My advice is only go this route if you have to.
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> >
> > "Patrice Lamarche" <Patrice_lamarche@.Removethis.gco.ca> wrote in message
> > news:unkvErc6EHA.4028@.TK2MSFTNGP15.phx.gbl...
> >> Hello Every one,
> >>
> >> I would like to know if it's possible to dynamicly build report againt RS
> >> ?
> >>
> >> Thanks alots
> >>
> >> Best Regards and seasons greetings!
> >>
> >> Patrice Lamarche
> >> Groupe Conseil Omnitech
> >
> >
>
>

Friday, February 24, 2012

Dynamic table in Crystal report

Hi there,

How can i display dynamic table on the crystal report dependes on the data. I mean how can i add and remove table columne dynamicly dependes on the data comes from the data base.
Thank you for your help...
Best regards,
hohoCan you be more specific on what you have been trying to do?|||Thank you for your reply.

There is a Clients on table in the database and there is another table the clients may has some values in this table and may not. What am trying to do is if the client has any values in this table the report disply the values in the table. this values may be 1 or more so i need to show the table and add the columne as need dependes on the values on the tables. All this need to be daynamicly not a fixed table.

Thank you for your time.

Regards,
hoho|||I dont think that is possible
Anyway check here
http://support.businessobjects.com/