23 / 03 / 2017

Usuarios conectados: 6

Cargando documento...



Este Sitio:













Mailing List:

Suscríbete a la lista de correo, No practico spamming y ofrece algunas ventajas.

Pulsa aquí para saber más y suscribirte.



Tecnorama >Tutoriales Dreamweaver


Generate Excel files with DWMX/PHP/MySQL (part 2)

Versión para imprimir | Translate this page

So far, we have seen how we can display static data and make calculated fields that Excel can understand and modify.

Now it's time to make the data dynamic: We shall pull it form a MySQL database and we shall see the modifications we have to add to the code written by DWMX.

This is our sample table:

1.- Create the Recordset:

2.- Make the table, give it some format and insert the Recordset Fields:

3.- Now, select the row where Recordset data is displayed and add a Repeat Region:

4.- When you have finished, hit F12: You should see how Excel is opened by the browser and will display something like this:

5.- Now let's start with the tricky part: We shall display the results for SUM and AVERAGE functions, which will need a range of cells to work: So far, we know the starting point of the range (look again at the image above: It will be B2, which is the coordinate for the first cell of the recordset, because B1 is filled with the header).
However, we don't know yet where one the end point will be. So, before we continue, we can put it as in the image below:

6.- Now, think about it: If we have 4 records in our example, the last cell of the results will be B5, if we had 6 records, it would be B7 and so on... That is:
The last row number will be the number of total records plus the number of rows we've got above the first Recordset row!!
Then, let's add the Server behavior "Display Record Count->Display Total Records":

7.- Now, just modify the code to add "1" to the total number of records. If you select the translated part in design view, it will be shown in code view. See below:

8.- Now, simply add "+1" to the code:

It's done!! our spreadsheet is ready to display the values!! Just remember that in the previous step you must add the number of rows you've got before the first row of the repeat region. In our example there was just one, but it could have been more.

You will also note that DW will display a couple of errors in the Server Behaviors panel. Don't worry about them: They simply mean that the code isn't the one DW expects to find for the "Display Total Records" Server behavior (we've added some code to it), nothing more.

¿Comentarios? 50, de momento. Mostrando 1 ->5

1.- That's a creative answer to a dilifcuft question http://zlrqgow.com [url=http://lzzqozpzrlf.com]lzzqozpzrlf[/url] [link=http://ugasmpn.com]ugasmpn[/link]

2.- THX that's a great ansewr! http://xucbzfdm.com [url=http://kjlehcwgz.com]kjlehcwgz[/url] [link=http://dlhwlbn.com]dlhwlbn[/link]

3.- This is both street smart and inltneigelt.

4.- I could watch Scd'ehlnris List and still be happy after reading this.

5.- I don't even know what to say, this made things so much eaiesr!

« Previous | 1 - 5 | 6 - 10 | 11 - 15 | 16 - 20 | 21 - 25 | 26 - 30 | 31 - 35 | 36 - 40 | 41 - 45 | 46 - 50 | Next »

Añade tu comentario

Escribe el código de la imagen superior:


Tutoriales Dreamweaver

-El muy buscado Menú desplegable

-¿Qué $%&$% es 'SSI'?

-Utilizar tablas de excel para actualizar tablas en html.

-Plantillas en DW MX: Regiones opcionales.

-Adaptar tablas a la ventana.

-Vista diseño para formatos no reconocidos

-Carga de imagenes en orden

-Mi primera Extensión

-Rollover remoto ('Disjointed Rollover')

-Iframes vs. Frames

-Contenido dinámico en celdas

-DW MX: Repeating Tables

-DW MX: Practica el Cloaking

-DW MX: CSS en tiempo Diseño

-Buscar y Reemplazar en Dreamweaver

-Menú dinámico

-Collaborative Dreamweaver: Design Notes and Files Panel

-Using PHP Server Formats and MySQL Dates

-Creando un Newsticker

-Generate Excel files with DWMX/PHP/MySQL (part 1)

-Manejo de fechas en PHP y MySQL

-Generate Excel files with DWMX/PHP/MySQL (part 2)

-Manejo de Fechas en consultas a MySQL

-Showing all records by default in a results page (PHP)

-Retrieving data using AHAH (1)

-Retrieving data using AHAH (2)

-Retrieving data using AHAH (3)

TECNORAMA es simplemente una página personal. No sirve ni de promoción del autor ni cosas por el estilo.
Todos los códigos, textos y tutoriales son de libre uso mientras se mencione al autor (no es mucho pedir)
Este sitio es compatible con IE6/NS6/Mozilla1.0
Para contactar, puedes enviarme un e-mail a tecnorama@hotmail.com