RSS

Exportar DataGridView c# para Excel

using System;
	using System.Collections.Generic;
	using System.Linq;
	using System.Web;
	using System.Web.UI;
	using System.Web.UI.WebControls;
	using System.Data.SqlClient;
	using System.Data;
	public partial class _Default : System.Web.UI.Page
	{
		protected void Page_Load(object sender, EventArgs e)
		{
			SqlDataAdapter adapter = new SqlDataAdapter();
			DataSet ds = new DataSet();
			int i = 0;
			string sql = null;
			string connetionString = "Data Source=.;Initial Catalog=pubs;User ID=sa;Password=*****";
			sql = "select * from publishers";
			SqlConnection connection = new SqlConnection(connetionString);
			connection.Open();
			SqlCommand command = new SqlCommand(sql, connection);
			adapter.SelectCommand = command;
			adapter.Fill(ds);
			connection.Close();
			GridView1.DataSource = ds.Tables[0];
			GridView1.DataBind();
		}
		protected void btntoExcel_Click(object sender, EventArgs e)
		{
			Response.ClearContent();
			Response.AddHeader("content-disposition", "attachment; filename=gvtoexcel.xls");
			Response.ContentType = "application/excel";
			System.IO.StringWriter sw = new System.IO.StringWriter();
			HtmlTextWriter htw = new HtmlTextWriter(sw);
			GridView1.RenderControl(htw);
			Response.Write(sw.ToString());
			Response.End();
		}
		public override void VerifyRenderingInServerForm(Control control)
		{
			/*Tell the compiler that the control is rendered
			 * explicitly by overriding the VerifyRenderingInServerForm event.*/
		}
	}

 

 
Deixe um comentário

Publicado por em 02/11/2017 em Asp.Net MVC

 

Tags: , , , , , , , , , , ,

Instalando/Utilizando o Protheus TOTVS em estações Linux 64 bits

linux

Instalando/Utilizando o Protheus TOTVS em estações Linux 64 bits

A empresa onde trabalho passou a utilizar o sistema Protheus desenvolvido pela TOTVS, e com o fim do suporte e atualizações de segurança do Windows XP será necessário trocar o sistema operacional, visto que muitas máquinas são antigas e não vão rodar bem o Windows 7, Windows 8, Windows 8.1 ou Windows 10, dessa maneira serão migradas para alguma distribuição linux. Executei a instalação e testes do Protheus em uma estação com a distribuição Debian e descrevi os passsos abaixo.

Primeiramente é necessário acessar a área de download da TOTVS e fazer o download dos arquivos necessário, para isso acesse: https://suporte.totvs.com/download

Selecione a Linha “Protheus”, depois em “Filtrar” escolha TOTVS Binário, e depois clique no binário referente a sua versão, no meu caso 14-01-29-p11-binario_linux.rar

Após isso será aberto uma tela com os detalhes, clique em “DOWNLOAD”.totvs-download2

Escolha a opção “Navegador Web”.

Aguarde o fim do Download

Vamos criar uma pasta onde colocaremos os arquivos do Protheus:


mkdir /totvs
chmod 777 /totvs
cd /totvs


Vamos extrair o arquivo “14-01-29-P11-BINARIO_LINUX.RAR” e copiar os arquivos da pasta “14-01-29-P11-BINARIO_LINUX.RARsmartclientLinux” para a pasta /totvs e extraí-los:


tar xfvz smartclient.tar.z
tar xfvz printer.tar.gz


Depois executamos o comando ldd para verificar as dependências:


ldd ./smartclient
not a dynamic executable


O retorno “not a dynamic executable” indica que necessitamos fazer o download e instalação dos pacotes para execução de aplicativos 32bits, assim executamos o seguinte:


dpkg –add-architecture i386
apt-get update
apt-get install gcc-multilib
apt-get install ia32-libs


Verificamos novamente as dependências:

ldd ./smartclient
linux-gate.so.1 => (0xf7744000)
libSM.so.6 => not found
libICE.so.6 => not found
libXrender.so.1 => not found
libXext.so.6 => not found
libX11.so.6 => not found
libgthread-2.0.so.0 => not found
libglib-2.0.so.0 => not found
librt.so.1 => /lib32/librt.so.1 (0xf7728000)
libdl.so.2 => /lib32/libdl.so.2 (0xf7724000)
libpthread.so.0 => /lib32/libpthread.so.0 (0xf770b000)
libm.so.6 => /lib32/libm.so.6 (0xf76e4000)
libc.so.6 => /lib32/libc.so.6 (0xf7580000)
/lib/ld-linux.so.2 (0xf7745000)


Agora o sistema informa que está faltando a lib libglib2.0, vamos instalar ela:

apt-get install libglib2.0-0:i386


Verificamos novamente se ainda existe alguma dependência:

ldd ./smartclient
linux-gate.so.1 => (0xf76fc000)
libSM.so.6 => /usr/lib/i386-linux-gnu/libSM.so.6 (0xf76dd000)
libICE.so.6 => /usr/lib/i386-linux-gnu/libICE.so.6 (0xf76c4000)
libXrender.so.1 => /usr/lib/i386-linux-gnu/libXrender.so.1 (0xf76b9000)
libXext.so.6 => /usr/lib/i386-linux-gnu/libXext.so.6 (0xf76a7000)
libX11.so.6 => /usr/lib/i386-linux-gnu/libX11.so.6 (0xf756f000)
libgthread-2.0.so.0 => /usr/lib/i386-linux-gnu/libgthread-2.0.so.0 (0xf756c000)
libglib-2.0.so.0 => /lib/i386-linux-gnu/libglib-2.0.so.0 (0xf746f000)
librt.so.1 => /lib/i386-linux-gnu/i686/cmov/librt.so.1 (0xf7465000)
libdl.so.2 => /lib/i386-linux-gnu/i686/cmov/libdl.so.2 (0xf7461000)
libpthread.so.0 => /lib/i386-linux-gnu/i686/cmov/libpthread.so.0 (0xf7448000)
libm.so.6 => /lib/i386-linux-gnu/i686/cmov/libm.so.6 (0xf7422000)
libc.so.6 => /lib/i386-linux-gnu/i686/cmov/libc.so.6 (0xf72be000)
libuuid.so.1 => /lib/i386-linux-gnu/libuuid.so.1 (0xf72b7000)
libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xf7294000)
libpcre.so.3 => /lib/i386-linux-gnu/libpcre.so.3 (0xf7256000)
/lib/ld-linux.so.2 (0xf76fd000)
libXau.so.6 => /usr/lib/i386-linux-gnu/libXau.so.6 (0xf7253000)
libXdmcp.so.6 => /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0xf724d000)

Como o sistema não retornou mais nenhum erro é só executar ./smartclient no terminal ou criarmos uma entrada para ele no menu, usando a ferramenta alacarte do gnome, por exemplo.

Fonte

Após a execução de todos esses processos, tivemos uma pequena dificuldade em mapear a impressora, já que o smartclient imprimir os pedidos direto na porta LPT2. Então tivemos redirecionar todas as impressões para um impressora instalada no cups !

Capturar

Após a instalação da impressora no servidor CUPS, teremos que configurar o smartclient.ini para reconhecer o redirecionamento e enfim enviar a impressão dos pedidos para a impressora desejada.

Capturard

Após a instalação da impressora no servidor CUPS, teremos que configurar o smartclient.ini para reconhecer o redirecionamento e enfim enviar a impressão dos pedidos para a impressora desejada.

Inserimos então as seguinte configurações no arquivo smartclient.ini

[Printer_Map_Port2Spool]

LPT2 =  NOMEIMPRESSORACUPS

A seção [Printer_Map_Port2Spool] define o mapeamento de portas de impressão para spool de impressão.

Com isso tudo se resolve.

Espero ter ajudado.

 

 
Deixe um comentário

Publicado por em 02/11/2017 em ADVPL

 

Tags: , , , , , , , , , , , , , , , , , , , , , ,

Golf Guru – Grasp the secrets to swing like a pro and conquer the course!

golfguru

Download

 

Grasp the secrets to swing like a pro and conquer the course! Get All The Support And Guidance You Need To Be A Success At Golf!
Golf is a game that is played outdoors and for those who are particularly fond of playing golf, weather conditions have little effect on the urge to get out and play.
Being a game that involved the use of several different clubs and a ball, this can be a very challenging game to venture into both in mind and body. Get all the info you need here.
Below are some of the information that you are about to learn:
What is the gold game all about
How to become a professional golfer
Getting your golfing gear ready
Knowing all the rules of golf game
It’s all started with building your swing
Establish your swing plane the right way
Rolling the game with your stroke
What you need to know about chipping and pitching
Common pitfalls for golf game
And so much more…

=====================================================
Submitted: 04 Aug 2016
File Size: 2,458.79 Kb
License: Master Resell Rights
Submitted: 04 Aug 2014
=====================================================

PS: This eBook does not violate any Etsy rules. It is a legal copy and I am within my rights to sell
this eBook. This information is in the public domain and was researched legally. No Trademark or copyrigth laws
have been violated. This eBook package was created under Etsy’s “Compilation & Informational MediaGuidelines”

I am an Authorized Reseller os this produck and also have resale rights to this eBook.
Full Resell Rights are granted by the copyright owners to sell theses E-books with Resell rights.
This ad is in compliance with all Etsy rules and regulaitons.

 

 
Deixe um comentário

Publicado por em 04/06/2017 em Livros

 

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Carregar uma partial view em uma div ASP.NET MVC

 type="text/javascript">
    $(document).ready(function () {
        $('#buttonId').click(function () {
            $('#divid').load('@Url.Action("About", "Home")');
        });
    });


<a id="buttonId">Load partial view or Any URL</a>
id="divid" style="height:100px; width:400px";>
 
Deixe um comentário

Publicado por em 18/01/2017 em Asp.Net MVC

 

Tags: , , , , , , , , , , ,

Anel Senhor Dos Anéis Tungstênio Negro O Um Anel

lord-of-the-rings-wallpaper1

02

O Um Anel – Senhor Dos Anéis – Tungstênio Negro

UM ANEL PARA A TODOS GOVERNAR, UM ANEL PARA ENCONTRA-LOS,

UM ANEL PARA A TODOS TRAZER E NA ESCURIÇAO APRISIONA-LOS.

O UM ANEL, FABRICADO EM CARBONETO DE TUNGSTÊNIO,COM INSCRIÇÕES ENTALHADAS A LASER.MEDIAS OFICIAIS: 07MM DE LARGURA E 2,7MM DE ESPESSURA.

POR SER O METAL MAIS DURO DO PLANETA, ITENS ELABORADOS A PARTIR DO TUNGSTÊNIO SÃO REFERÊNCIAS EM DURABILIDADE E RESISTÊNCIA, APRESENTANDO-SE COMO PEÇAS INCRIVELMENTE TOLERANTES A QUEDAS E IMPACTOS SOB OS QUAIS OUTROS TIPOS DE METAIS FACILMENTE SE QUEBRARIAM OU SE DEFORMARIA.

COMPRAR

DISPONÍVEIS NOS TAMANHOS.

19 – Circunferência = 55,7 mm Diâmetro = 17.73

20- Circunferência = 57.0 mm Diâmetro = 18.14mm

21- Circunferência = 58.3mm Diâmetro = 18.54mm

 
Deixe um comentário

Publicado por em 14/01/2017 em Bons Negócios

 

Tags: , , , , , , , , , , , , , ,

Catálogo Hinode Ciclo 01 2017 

Download 

Quer ser um Consultor (a) Hinode ?

CADASTRE-SE

 
Deixe um comentário

Publicado por em 05/01/2017 em Livros

 

Tags: , , , , , , , , , , , , , , , ,

Lançamentos Hinode 2016


Eterna Crystal 

Link: http://bit.ly/1QDKXmw

Empire Vip

Link: http://bit.ly/24urfnC

 
Deixe um comentário

Publicado por em 12/07/2016 em OfertasHinode

 

Tags:

Máscara Facial Routine Hinode 

Mascaras faciais Routine

R$35,00

Link: http://bit.ly/29nLLTv

Cuidados básicos e fórmulas inovadoras para manter
a pele sempre bonita e saudável.
60019
ROUTINE

Super Hydrat

Máscara Facial Hidratante

com Ação Hidratante

Ideal para peles opacas e com

tendência à descamação.

50 g
60018
ROUTINE

Quick Detox

Máscara Facial Purificante

com Ação Purificante.

Ideal para peles com

tendência à oleosidade e

poros obstruídos

50 g
60020
ROUTINE

Flash-Energy

Máscara Facial Revitalizante

com Ação Revitalizante

Ideal para peles cansadas e

sem brilho

50g

 
Deixe um comentário

Publicado por em 05/07/2016 em OfertasHinode

 

Tags: , , , ,

Imagem

Curta Nossa Página

13412985_1026352870747743_5231012639165703388_n

 
Deixe um comentário

Publicado por em 26/06/2016 em Livros

 

Perfume Feminino Eterna 100ml Hinode

image

🎁Eterna 100ml🎁

✅Link: http://bit.ly/1QDKXmw

Com personalidade marcante, criada por notas florais como a Frésia, a Rosa e o Jasmim, a fragrância revela uma beleza sutil e envolvente. Delicada como o amanhecer em um jardim de flores, especial como a lembrança de um momento único e marcante.

#Hinode #Perfume #Eterna #Cosmeticos

 
Deixe um comentário

Publicado por em 24/06/2016 em OfertasHinode

 

Tags: , , , ,