Jump to content

help_lucky

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

help_lucky's Achievements

Member

Member (2/5)

0

Reputation

  1. I want to download the records of the output of search criteria to excel. As the fields for search criteria are more than 20. I am submitting the form with POST method rather than GET. On click of "Download2excel", the hidden variable name1 is set to Yes. so i will check the condition in my code. Once the download is successful, I want to reset the variable. Here is a sample structure of my code. <html> <head> <?php if(trim($_POST['name1']) == 'yes') { header("Content-type: application/vnd-ms-excel"); header("Content-Disposition: attachment; filename=$filename.xls"); }else { ?> </head> <body onload="tempFn()"> <script language="javascript" type="text/javascript"> function tempFn(){ global_search.name1.value = ""; } function gs_download2xl_c() { document.getElementById('name1').value="yes"; document.global_search.submit(); } </script> <form name="global_search" id="global_search" action="test_1.php" method="POST"> <input type="text" id="name1" name="name1" /> <a class="underline" style="cursor: pointer" onclick="gs_download2xl_c();"> Download2excel </a> </form> <?php } ?> </body> </html> As i am not executing the form after posting the form, i am not able to access the variable name1 is in it. I want to reset the variable name1. I want to trigger the download, after submitting the form. As the records that are downloaded to excel should obey input search criteria. Please suggest me a better procedure.
  2. Hello Everyone, I need to upload excel sheet in to the database. Which i am doing with the query SELECT * INTO temp FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\Dokumente und Einstellungen\l.varada\Desktop\BA-Control.xls', 'SELECT * FROM [qry_BA_Controlling (Report)$]') Here C:\Dokumente und Einstellungen\l.varada\Desktop\BA-Control.xls is the path from where the excel file needs to be fetched. qry_BA_Controlling (Report) is the name of the worksheet. So on executing the query, a table with name 'temp' is created. With records that are populated from excel. Now here i have a date field in excel. sometimes the values of this field are not uploaded properly into the temp table. The values for this date field are set to NULL eventhough they have values in EXCEL. I have modified my query so, Insert into temp Select * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\Dokumente und Einstellungen\l.varada\Desktop\BA-Control.xls', HDR=YES', 'SELECT * FROM [qry_BA_Controlling (Report)$]') Here temp is an existing table, i have defined the date type of the field [creation date] to varchar and uploaded the excel. Then i used **convert** to change the datatype to the correct format.. update temp set [Creation date] = CONVERT (varchar,[Creation date],101) Even now it is populating NULL values..Or this conversion needs to be done while uploading. if so, please let me know or suggest me an alternative approach..
  3. Today i have tried with a different input. surprisingly i am not able to upload with the last working excel file too.
  4. Hi All, I have a requirement in which, i upload excel sheets to sql server database. The business logic is executed and display as reports in php. It is working fine till yesterday. Today i tried to upload excel files. It is throwing an error message stating:- The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" could not find "installable ISAM." Query that i used in the stored procedure:- EXEC('SELECT * INTO temp FROM OPENROWSET(''Microsoft.Jet.OLEDB.4.0'', ''Excel 8.0;Database=' + @ba_bm_status + ''',' + '''SELECT * FROM [qry_BA_Controlling (Report)$]'')'); @ba_bm_status - i/p parameter of srored procedure qry_BA_Controlling (Report) - worksheet name webserver used:- IIS, connection is through odbc. I have no information about this error. Can you please help me in solving the same.
  5. Yes both have the values. As i am submitting the same form onclick of both the checkboxes. onclick --> checkbox A .---> trigger form with name "form_name" --> Fetch the values from php for 1st set of fields. onclick --> checkbox B .---> trigger form with name "form_name" --> Fetch the values from php for 2nd set of fields. My question is, as it is triggering the same form onclick of checkbox A&B. Is there any way how i can indentify which(Checkbox A or checkbox B) is checked. from $_POST, i will get the values of the checkboxes, but not which one is clicked, for this form to get submitted.
  6. Thanku for ur reply. Requirement:- I have a form, in which i have 2 checkboxes. Onclick of a checkbox, values for first set textboxes(that are in the same form) needs to be fetched automatically. onclick of another checkbox the value of select tag and textarea needs to be filled. My approach:- I have created 2 checkboxes and onlclick of each of the checkboxes i am submittting the same form. From where i can fetch the values using php code. print_r($_post) will return Array(checkbox1=>primary checkbox2=>secondary). The value of first and second checkboxes. But i will not able to find which is checked by this click. It just returns values of the checkboxes. But does not give me the info, onclick of which checkbox the form got submitted. So, The question is how will i come to know, if the form got submitted, by click of first checkbox or second. Hope i am clear in explaining the questions and waiting for replies.
  7. I don't know how to copy table data from one server -> database -> table TO other sever -> database -> table. If it is with in the same server and different databases, i have used the following SELECT * INTO DB1..TBL1 FROM DB2..TBL1 (to copy with table structure and data) INSERT INTO DB1..TBL1(F1, F2) SELECT F1, F2 FROM DB2..TBL1 (copy only data) Now my question is copy the data from SERVER1 --> DB1--> TBL1 to SERVER2 --> DB2 -->TBL2
  8. 1 I have a requirement in which, i need to upload an excel file into SQL Server database. It is working well till this point. But sometimes i am getting excel file in such a way, that the first 2 rows and columns are empty rows. That is not even fixed every time. so the format of the table after upload is not as expected. It is assigning F1, F2 as column names for the table in SQL Server. It varies from file to file. I want to program it in such away so that the user can enter the row number and the column number from where the actual data is starting. So that while upload it should from line 3 and column 2. I don't know how to specify that row and column while uploading. Please help me to solve the same.
  9. Hello Everyone, I have 2 checkboxes in a form and onclick of these. Once the checkbox is checked, only the fields that are relevant to the checkbox are displayed, with default values in it and to fetch the default values i need to trigger php code. So i can't perform the operation once the whole form is submitted. As the client i am working for does not support AJAX. I can't go for it. So i have written onclick = document.formName.submit(); Now it is triggering the same page and i am able to write the code. I am not able to differentiate which checkbox is checked. I don't want to use the procedure of:- calling javascript and then storing the value of the checkbox in a variable and making this variable as invisible. I would like to write something like document.formName.submit('checkbox1'). So that i should be able to handle the value of this or i dont know. Please suggest me an alternative method or better approach.
  10. That's good idea. It's quite elaborative...Thanku for your time and for detailed response. I will try this way.
  11. Hi all, I want to print a page from another page. I have a master page with links to other page. When I click "print," it should print the another page. The function window.print() is printing only the active page. So on click print i am opening a new window. In the onload event of the target page i have used <body onload="window.focus();window.print();window.close ();"> Eventhough it's working, at the same time the window is also popping up behind the printer set up screen. when i click print or cancel the window gets closed automatically. i don't want the window to pop up. Do suggest me if there is any other alternative way.. Thanks for your help.
  12. Hello Everyone, I am struggling to print a page in landscape. The reason behind to print in landscape was that, the table has many coulmns or anything else can be done besides printing in landscape?. Even the print function is not producing total satisfactory output... I am calling window.print on the onload event of the target page and then closing it. But it is opening then giving me an option to select the printer then closes automatically. But is it possible to print an other page without opening--> printing-->closing. I mean printer options to print an other page on click of a button. Please help me to solve this issue! or suggest me an alternative method .
  13. Hello, You gave me a good food to think..Thanku very much...The problem is solved...It is using cookies i did it... [quote]function timedCount() { if(c==0 && (getcookie("remind")!=null) && (getcookie("remind")!="") && getcookie("remind")!=1) { c = parseInt(getcookie("remind")); } c=c+1; document.getElementById('txt').value=c; document.cookie="remind"+ "=" +escape(c); if(c==30) { window.focus(); window.alert('Please call originator'); c=0; delete_cookie("remind"); } t=setTimeout("timedCount()",1000); } function doTimer() { if (!timer_is_on) { timer_is_on=1; timedCount(); } }[/quote] I created a invisible text field in the page where i am calling this function..
  14. Thanku very much for the time taken and for the response.. If that is the case then i will call the function cTimer(); on every page. Because whatever may be the page on the site i need to get a popup. So it will check whether the timer 2 hrs is done or not and then call this function. To give an alert message. But what if the user does not click/no action on the site for more than 2 hrs. Then the cookie expires and we will not get any alert message. If he clicks 1:50 mins after the cookie is set and then does not do anything thereof..we will not get any popup..Only if he is active after 2 hrs the cookie is set..then we get a popup... I need a popup for every 2 hrs even if the user is active or not on the site. Do let me know if anything is not clear from my side. Suggest me if any improvements can be done to meet the requirement.
  15. Hello Everyone, I am banging my head since morning. please help me.. I am not so good at php..i am in learning phase... My requirement was to generate a popup once you immediately login. windows.alert('please call') then the popup should come for every 2 hrs. Even though you navigate to different pages on the site..This should still come.. I have started something like this:-- 1. Calling this script on everypage. <script type="text/javascript"> alert_settimer(); </script> And the code in the script is function alert_settimer(){ time_stop=2*60*60*1000; if(time_stop > 0) { timer= setTimeout("alert_settimer(),window.focus();window.alert('Please call Originator');",time_stop ) } } It is able to give me a popup for every 2 hrs. But whenever the user reloads the page after 1 hr. The function is called again and the count starts from 0hrs again. OR for example if 20 mins already passed then if i am going to a new page then the function is called again and so the timer starts again. I am not getting any idea how to restrict it calling every time. OR send that 1 hr again to the function so that it starts from there. I tried some thing like setting the value in a session variable and then starting the counter from that value. But i am not successful. Please help me in solving this...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.