Is there a way javascript access DataTable?
-
I want use javascript control excel to print report at client,The Datasource is Datatable,I don't know how javascript access DataTable data. Please give some tips,Thank you.
I encounter similar problem before. In my case, i used server scripting to generate the client javascript. as below... ////////////////////////////////////////////////////// DataTable DataTable1 = ....... //code your create virtual table using server scripting here Response.Write (""); foreach(DataRow DRow in DataTable1.Rows) { Response.Write ("alert('" + DRow["YourDataFieldName"].ToString() + "')"); } Response.Write ("<_ " + "script>"); <----- server error reading my typed '/' here -- modified at 5:04 Monday 2nd January, 2006
-
I encounter similar problem before. In my case, i used server scripting to generate the client javascript. as below... ////////////////////////////////////////////////////// DataTable DataTable1 = ....... //code your create virtual table using server scripting here Response.Write (""); foreach(DataRow DRow in DataTable1.Rows) { Response.Write ("alert('" + DRow["YourDataFieldName"].ToString() + "')"); } Response.Write ("<_ " + "script>"); <----- server error reading my typed '/' here -- modified at 5:04 Monday 2nd January, 2006
-
Hi zrocb81,Thank you for your help. Because I have to format excel report,so I want to use javascript access DataTable,not at server side.
i'm not sure with the javascript format excel report. But as i know, there is no way for javascript--CLIENT scripting to access directly to DataTable in SERVER scripting. Unless you use server scripting to generate the client script, or else it's impossible for javascript read data directly from server side DataTable.
-
Hi zrocb81,Thank you for your help. Because I have to format excel report,so I want to use javascript access DataTable,not at server side.
-
I want use javascript control excel to print report at client,The Datasource is Datatable,I don't know how javascript access DataTable data. Please give some tips,Thank you.
you can only access that data through an Ajax call. For client javascript pls refer: At Server u should have a page that directly outputs xml from database. Take response.Stream to datatable ' xmlwriter to give direct xml Mikail Çetinkaya . The C# DEveloper
-
you can only access that data through an Ajax call. For client javascript pls refer: At Server u should have a page that directly outputs xml from database. Take response.Stream to datatable ' xmlwriter to give direct xml Mikail Çetinkaya . The C# DEveloper
-
Thank you for your answer! I never heard 'Ajax call',Could you give me more tips? I think this is good way.
ajax is all about producing & consuming data through Xml and asynchronous javascript calls look at ajax professional lib(microsoft implementation of it) on msdn.microsoft.com Mikail Çetinkaya . The C# DEveloper
-
ajax is all about producing & consuming data through Xml and asynchronous javascript calls look at ajax professional lib(microsoft implementation of it) on msdn.microsoft.com Mikail Çetinkaya . The C# DEveloper