Fungus1487 55 Posting Pro in Training

well i am almost certain you cant use relative positioning with the technique you are using but i have frequently used the opening div as a placeholder for inner relative elements.

E.g if you move your css into an outer div and wrap what you already have. (without moving the position:relative information) you get.

<div style="float:right;width:20%;">
	<div style="position:relative;background-color:blue;left:0px;top:5px;z-index:4;">
	  <p class="yrs">yyyy - yyyy</p>
	</div>
</div>
<div style="width: auto;margin-right:20%;">
	<div style="position:relative;background-color:blue;left:0px;top:0px;z-index: 4">
	  <p class="c5">Company</p>
	  <p class="c4">Job Title</p>
	  <p class="c4">Description. (This can be quite long and is a key factor for making the height automatic since</p>
	</div>
</div>

im still not 100% sure what your after. Hopefully that helps.

Fungus1487 55 Posting Pro in Training

are you displaying tabular information ?

it very much looks like it.

one thing is tables are NOT bad. But are simply bad when using them for entirely different purposes than they were created for.

If you have tabular data use tables.

dwlamb_001 commented: Helpful. Informative. A gent of the first order +1
Fungus1487 55 Posting Pro in Training

if you used a server side language such as php/asp.net you could generate content based on say what a client has stored in a database.

this is how most heavy client edited sites work that i have worked on due to them not having to have any experience with the actual code behind.

Fungus1487 55 Posting Pro in Training

aspose are usually the best ones i see on the net for any third part tool.

just contact them. tell them what you require and they can say yes or no to whether the solution they offer will fill in all the parts you need.

Fungus1487 55 Posting Pro in Training

thats correct you need to get the whole querystring aswell if you want to retain the querystring variable. E.G.

action="<? echo $_SERVER["REQUEST_URI"]; ?>"
Fungus1487 55 Posting Pro in Training

This is a case of using a safe (ish) third party tool (which after having looked havent found any decent free ones) or being very careful over how you implement it.

Seeing as you did not want to use a 3rd party tool anyway.

ask yourself how often is this feature required and just how much processing is going into. obviously the more processing the higher the risk of it falling over.

for the level of manipulation you want i doubt there is any other way (bar the 3rd party tool route). personally i have only ever manipulated outlook in this way and the results have been fine for me, this was on a clients server with roughly 10 - 20 users at any one time.

and i also missed a vital part out of that code snippet above

System.Runtime.InteropServices.Marshal.ReleaseComObject(wordDoc)
    System.Runtime.InteropServices.Marshal.ReleaseComObject(wordApp)

to free up the com object after use.

As with the open XML approach i may be wrong but i believe office 2007 is a must have for this work e.g. the client will require office 2007 on there machine or the free office 2007 reader to open a document. This may not be a problem in the future but i dont know any of my clients that are currently using the office 2007 suite.

Tools for actually writing open xml aare the simple system.xml classes. This is the reasoning behind openxml so that developers anywhere can maniupluate these standardised documents. I cant …

Fungus1487 55 Posting Pro in Training

Hey Hey.

i managed to get this working. It just simply changes the text inside a bookmark in a word document.

<%@ Page Language="VB" Strict="true" %>
<%@ Import namespace="Microsoft.Office.Interop.Word" %>
<%
    Dim strValue As String = Request.QueryString("value") ' dynamic value to change bookmark text
    
    Response.Clear()
    Response.ContentType = "application/msword" ' Add word header
    
    Dim wordApp As New Microsoft.Office.Interop.Word.Application
    Dim wordDoc As Microsoft.Office.Interop.Word.Document = wordApp.Documents.Add(Server.MapPath("yourname.doc")) ' Load my template word document
    Dim strFTmp As Object = System.IO.Path.GetTempFileName ' Get a temporary filename as cannot stream directly to response.output
    
    wordDoc.Bookmarks.Item("yourName").Range.Text = strValue ' Change bookmark value
    wordDoc.SaveAs(strFTmp) ' Save to temp file
    wordDoc.Close()
    wordDoc = Nothing
    wordApp.Quit(False)
    wordApp = Nothing
    
    Response.WriteFile(CStr(strFTmp)) ' Write file to response stream
    %>

this seemed to work for me. i had some hassle giving the "ASPNET" user account permission to launch the COM object but once you get around that it looks easy enough.

Fungus1487 55 Posting Pro in Training
<?
if(isset($_POST["yourname"])) {
  // Process database save
}
?>

<html>
    <body>
        <form action="<? echo $_SERVER['php_self']; ?>" method="post">
            <input type="text" name="yourname" />
            <input type="submit" value="enter data" />
        </form>
    </body>
</html>
Fungus1487 55 Posting Pro in Training

i have just looked into this a bit more and have found out you can use the com librarys to manipulate your powerpoint presentation.

i found this word example but havent tried it good luck http://www.codeproject.com/KB/aspnet/wordapplication.aspx

Fungus1487 55 Posting Pro in Training

i dont see any other way of doing this then than the original open XML approach. Be warned to do something like this will take 100's - 1000's of lines of XML

Fungus1487 55 Posting Pro in Training

??? sorry i dont quite understand what your asking ??

Fungus1487 55 Posting Pro in Training

couldnt you use VBA in the ppt itself. You can use tcp/ip connections thru VBA. it may be along winded approach but without using a third party tool you may be solving this nightmare for a very long time.

Fungus1487 55 Posting Pro in Training

why do you need to use ajax ?
you can do a simple postback which is alot easier.

if ajax is amust you must have some knowledge of javascript aswell.

Fungus1487 55 Posting Pro in Training
SELECT startpost.posttitle, startpost.dat, creuser.username FROM startpost INNER JOIN creuser ON startpost.userid = creuser.uid

That will display all the startpost data with the username for the startposts. Specifying a Where clause like below will let you show one startpost record based on its id.

SELECT startpost.posttitle, startpost.dat, creuser.username FROM startpost INNER JOIN creuser ON startpost.userid = creuser.uid WHERE startpost.postid = 1

This is really quite basic and i suggest you read some articles explaining "JOINS" a good one is here w3schools

Fungus1487 55 Posting Pro in Training

I agree i would also almost always choose .NET simply for the complete lazyness that visual studio offers me as a developer.

Fungus1487 55 Posting Pro in Training

but if you have to use mysql then go the php route as it is integrated alot better into the php language.

Fungus1487 55 Posting Pro in Training

do you have flash installed for internet explorer as firefox uses a seperate plugin to IE. Also use firefox. It is a faster browser!

Fungus1487 55 Posting Pro in Training

There is a problem with your javascript code somewhere as "document.getElementById" is perfectly fine for obtaining a table element with an ID.

Fungus1487 55 Posting Pro in Training

you cannot nest a form within a form as set by w3c.

Fungus1487 55 Posting Pro in Training

hmm.. I would use confirm box too. But if you want to have custom buttons, thats the only way, a popup.

personally i would float a DIV over the center of the page with two buttons in. Faking a popup as i rekon this would achieve sameeffect without popups (probably cuz i hate popup windows :D). but hey it depends how much trouble you want to go into to making two buttons look different.

Fungus1487 55 Posting Pro in Training

what if popups are disabled ?
i suppose you could check if the window is opened after calling the popup script but i would stick with the javascript confirm option as it is likely to cause you less grief.

Fungus1487 55 Posting Pro in Training

what was the issue? may help others if they ever get stuck with similiar problem

Fungus1487 55 Posting Pro in Training

can you put some error listing up here ?

Fungus1487 55 Posting Pro in Training

you dont need str_replace inside str_replace etc etc.

use two arrays

$your_txt = "Hello 'WORLD'";
$txt = array("'", "\"");
$txt_replace = array("\'", "\\\"");
$x=str_replace($txt, $txt_replace, $your_txt);
echo $x;

this way you can have two arrays and no messy inner replacements inside replacements.

although nav33n may have shown you his way as at first it appears easier (both do the same trick).

Venom Rush commented: Nice variation from what was suggested +1
Fungus1487 55 Posting Pro in Training

no problem at all you can mark the post as solved if you like :D

Fungus1487 55 Posting Pro in Training

its is because the bar is positioned absolutely.

and when you set a width of 100% it is 100% of the viewable area so when your content is larger than your browser it exceeds 100%.


dont position it absolutley. this is bad.

perhaps use a table layout for the top ?

Fungus1487 55 Posting Pro in Training

i dont beleive you can upload a directory at all in php.

they could upload a zip file then use php to break apart the file and then create the directorys/file structure in this.

Fungus1487 55 Posting Pro in Training

how are you displaying these items ?

Fungus1487 55 Posting Pro in Training

i dont know why you would need a dll but anyway.

you will need to do 3 things

1. basic page with your textbox in. Then use the following javascript to pass a query to the server along with your variable of what has been entered so far in the textbox. This is done using the GET method or passing a variable in the url.

// ########## STORES THE XMLHTTP OBJECT
var xmlhttp = createxmlhttp();

// ########## CREATES AN XMLHTTP OBJECT
function createxmlhttp() {
	var xmlhttp;

  	if(window.ActiveXObject) { // INTERNET EXPLORER
    	try {
      		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    	} catch (e) {
      		xmlhttp = false;
    	}
  	} else { // OTHER BROWSERS
    	try {
      		xmlhttp = new XMLHttpRequest();
   		} catch (f) {
      		xmlhttp = false;
    	}
  	}
    
  	if (!xmlhttp) { // RETURN THE OBJECT OR DISPLAY ERROR
		alert('there was an error creating the xmlhttp object');
  	} else {
    	return xmlhttp;
	}
}

// ########## MAKE AN ASYNCHRONOUS CALL USING THE XMLHTTP OBJECT
// ########## THE VARIABLE STR BEING THE TEXT ALREADY ENTERED
function searchforwords(str) {
	try {
  		// PROCEED ONLY IF OBJECT IS NOT BUSY
		if (xmlhttp.readyState === 4 || xmlhttp.readyState === 0) {
    		// EXECUTE THE PAGE ON THE SERVER AND PASS QUERYSTRING
    		xmlhttp.open("POST", "autocomplete.aspx?text=" + str, true);
    		// DEFINE METHOD TO HANDLE THE RESPONSE
    		xmlhttp.onreadystatechange = handleresponse;
    		// MAKE CALL
    		xmlhttp.send(null);
						
  		} else {
    		// IF CONNECTION IS BUSY, WAIT AND RETRY
    		setTimeout('searchforwords("' + str + '")', 1000);
  		}
  	} catch(e) {
  		alert('ERROR: ' + e);
  	} …
Fungus1487 55 Posting Pro in Training

sorry what i meant was to a user it would appear as www.domain.com/page.html instead of say .aspx

Fungus1487 55 Posting Pro in Training

after re-reading you say you want them to download THE files.
the only way to do a batch download is either open a window for each file, create a zip file on the fly with all files inside, or have aprompt for them to download file sone at a time by selecting them

Fungus1487 55 Posting Pro in Training

well theres no file your just referencing the directory "Docs/##/EP/" ? try passing a filename through ?

also 'file.Length.ToString());' will not return the files size as its just a string variable you will need to do a

FileInfo finfo = new FileInfo(Server.MapPath(MyFile));
long FileInBytes = finfo.Length;

then use the 'FileInBytes' attribute to show the file length

Fungus1487 55 Posting Pro in Training

you can technically fake the interaction if thats what he means.

AJAX uses javascript to interact with a server side page. you dont actually see the page interacting with the javascript so it would technically be a html page. so to speak.

Fungus1487 55 Posting Pro in Training

set your permissions to allow access to my documents.
saying that i remember not being allowed access to a servers My Documents folder even with permissions set.
use another file location i.e.
c:\WEB APP FILES\

Fungus1487 55 Posting Pro in Training

ok then just simply add an onchange event to your FILE input.

<form name="form1"/>
    <input type="file" name="filediag" style="display:none"
            onchange="window.open(this.value, '_blank')" />
    <input type="button" value="browse..." 
            onclick="document.form1.filediag.click()" />
</form>

the above code will open the path of the file in a new browser window.

be aware this is only supported by I.E.6 + mozilla 1.5+ i believe as the onchange event in an INPUT of type file never used to work.

Fungus1487 55 Posting Pro in Training

you cant hide the textbox but if you set the display style property of the FORM element to 'none' and create another element of type button then using javascript you can open the dialog onClick of the button e.g.

<form name="form1"/>
    <input type="file" name="filediag" style="display:none" />
    <input type="button" value="browse..." 
            onclick="document.form1.filediag.click()" />
</form>
Fungus1487 55 Posting Pro in Training

there seems to be alot of processing on the server to simly just change these pages why not use CSS css tabs with iframes then just load your aspx page into the iframe on tab change, not only would it be complient across all modern browsers but it would save pointless postbacks.

Fungus1487 55 Posting Pro in Training

i dont know of any third party tabs but when i need tabs i use iframes. with a form for each page you want in each then use javascript to change the page.

Fungus1487 55 Posting Pro in Training

Hello, I need to access the database when a session unexpectedly ends or session times out. This is just for telling the database to update a field for when the user last logged in. The reason I need this is that it saves me tons of coding for other stuff so I do not have to use excess database ruitines, excess functions, etc.

Please if you know how to force the server to do an update on session timeouts or unexpected ends, please help.

asp.net 2.0
vb.net or lower
MySQL

goto the 'CODEBEHIND' in your global.asax file located at the root. then there are events in their to handle all these occurances.

i.e. session start / end, application start / end even an event for request if the need for validation is so great.

something like

Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
    Dim cnn as new ADODB.Connection
    cnn.connectionstring = "YOUR CONNECTION STRING"
    cnn.open
    cnn.execute("your SQL query")
    cnn.close()
    cnn = nothing
End Sub

but why not change this value on login seeing as it is LAST '''LOGIN''' DATE

Fungus1487 55 Posting Pro in Training

? sorry can you rephrase that as i have no idea what you mean. if you know insertion and connection why cant you do it ?

Fungus1487 55 Posting Pro in Training

just like you have your make table array method in a seperate method which is then called to get the current array you can do the same with creating the table

in your code you will have the INIT() statement and inside this method will be your table being created i.e.

runDisplay.setModel(
new javax.swing.table.DefaultTableModel(
            makeTableArray(),
            new String [] {
                "Date", "Distance (Miles)", "Run Time (hh:mm:ss)", "Run Time (Minutes)", "Avg. Time (Min/Mile)", "Route", "Conditions", "Notes"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });

all you have to do is make another method e.g.

private void CreateMyTable(){ .... table code above ....}

and remove it from the INIT method and replace it with CreateMyTable()

therefore it will still create your table but whenever you need to refresh it you can call 'CreateMyTable()' ? understand? if not let me know which bits u dont quite understand. Hope it helps

Fungus1487 55 Posting Pro in Training

there are some free components available that allow you to view excel documents in asp.net i cant think for the love of god where i saw them tho. best to GOOGLE it. Another alternative is to use something like a datagrid and create your own excel like application. this way you would have full control over everthing as youve hand made it.

Fungus1487 55 Posting Pro in Training

im pretty certain you will have to recall the 'table.setmodel' again. As it is not dynamically updating from the array it just sets the table to the data given at the tume the table is created. probably best to create another method that creates your table and sets its defaults etc then call this when you need to update. hope that helps

Fungus1487 55 Posting Pro in Training

easiest way is to store your data in a multidimensional array on the page load.

then when a user presses a button i.e. next record just increment the array value. the same idea is used for getting values from a database for every request.

you need some way of storing where you are at in the list of records that are returned from the db. And you wont want to loop through with a for loop everytime. if u change that for loop to add the data to an array then use the array youll find its alot easier

Fungus1487 55 Posting Pro in Training

two ways.

1) USE TABLES

2) add a margin to your content i.e.

<div style="margin-left:200px;">CONTENT HERE, CONTENT HERE</div>

hope that helps

Fungus1487 55 Posting Pro in Training

this code is under next button click ?

have you checked what is stored in maxrws ?

what integer value does it contain ?

Fungus1487 55 Posting Pro in Training

no idea why my first comment is there ?

Fungus1487 55 Posting Pro in Training

after pressing submit validate fields i.e.

if ($textboxvalue == "") {
  // go back and error
}

then perform an sql request (im guessing you using a database)

"SELECT * FROM databasename WHERE statementnumber = " . $statementnumber . ";";

then check if a result is returned.
if one is then you know you have a result in the database with this number and you can refer the user to whichever page required.

also you will not need to empty any variables as you will always perform this check and if there is a value and they press back it will falg a record is already in the database. Hope this helps

Fungus1487 55 Posting Pro in Training

after pressing submit validate fields i.e.

if ($textboxvalue == "") {

Fungus1487 55 Posting Pro in Training

For some reason the stylesheet containing box layout isn't applied in IE.

I mainly use firefox when designing, so it would be best to view the page in that one, but the idea is to also get it working in IE afterwards

majority of people use I.E. wouldnt it make sense to get it to work in that first ? although theres no reason why you cant get something working across all browsers. it just takes TIME and EFFORT