Hi,
Below is sample output in x12 EDI format. I'm using vb.net to create this
output file but i'm not sure if .NET has any tools to make the coding more
organized and/or efficient. Right now the only way i can think to create
each segment is by hardcoding the different elements into a string. For
example, to create the N1 segment i'll do this:
Dim sN1 as string = "N1*IM*" & drv("importer_n ame") & "*" &
drv("consignee_ code") & "*" & drv("consignee_ name")
I would do this for each record. This looks a little clumsy and was
wondering if there's maybe a way to predefine these record layouts or create
a template or some sort which can be used to make things easier to read. I'm
used to working with Dibol where you can create record layouts for this kind
of stuff. Advice will be greatly appreciated. Thanks!
ISA*00* *00* *ZZ*SENDER *ZZ*CBP
*070822*0940*#* 00501*000000001 *0*T*:
GS*SF*SENDER*CB P*070822*0940*1 *Y*005010
ST*333*0001
BGN*00*1234567-8*20070822*1005 *LT**ET
V1*7777777***** **L*S
N9*FC*FLR
N7*SCA1*1234567
N7*SCA2*9876543
N1*IM*Importer* 93*99-999999900
N1*CN**93*99-999999900
N1*IU*SCA3
N9*BM*111111111 1
N1*IU*MAEU
N9*MB*222222222 2
N1*SE*SellerNam e1
N3*123 Seller Street
N4*SHENZHEN**51 8008*CN
N1*SE*SellerNam e2
N3*555 POS Avenue
N4*SHENZHEN**51 8008*CN
N1*BY*Buyer
N3*777 Buyer Boulevard
N4*Seattle*WA*9 8101*US
N1*ST*Buyer - Loc1
N3*555 Shipto Avenue
N4*Seattle*WA*9 8101*US
N1*X2*StuffingL oc
N3*333 StuffLoc Street
N4*SHENZHEN**51 8008*CN
N1*CS*Consolida torName
N3*999 Consolidator Court
N4*SHENZHEN**51 8008*CN
N1*ST*Buyer - Loc2
N3*987 Shipto Street
N4*Indianapolis *IN*98101*US
N1*MF*Manufactu rerName1
N3*1357 Manufacturer Way
N4*SHENZHEN**51 8008*CN
TC2*A*HTSCD1
N1*CT*China*38* CN
TC2*A*HTSCD2
N1*CT*China*38* CN
N1*MF*Manufactu rerName2
N3*555 Maker's Street
N4*TSIM SHA TSUI EAST KOWLOON***HK
TC2*A*HTSCD3
N1*CT*Hong Kong*38*HK
SE*46*0001
GE*1*1
IEA*1*000000001 3 1958
Dim sN1 as string = "N1*IM*" & drv("importer_n ame") & "*" &
drv("consignee_ code") & "*" & drv("consignee_ name")
I would use a template String and a string.Format thus:
-------------------------------------------------------------
Dim Template as String = "N1*IM{0}*{1}*{ 2}"
Dim ThisRecord as String = string.Format(T emplate,drv("im porter_name"),d rv("consignee_c ode"),
drv("consignee_ name")
-------------------------------------------------------------
I would also probably use constants instead of literals for 'importer_name'
etc
--
Rory
Thanks! I wasn't aware of template strings. I believe this will work for me.
"Rory Becker" wrote:
Dim sN1 as string = "N1*IM*" & drv("importer_n ame") & "*" &
drv("consignee_ code") & "*" & drv("consignee_ name")
I would use a template String and a string.Format thus:
-------------------------------------------------------------
Dim Template as String = "N1*IM{0}*{1}*{ 2}"
Dim ThisRecord as String = string.Format(T emplate,drv("im porter_name"),d rv("consignee_c ode"),
drv("consignee_ name")
-------------------------------------------------------------
I would also probably use constants instead of literals for 'importer_name'
etc
--
Rory
I wrote classes for each segment type and a class called X12Segment that
they all inherit from.
John Walker wrote:
Hi,
Below is sample output in x12 EDI format. I'm using vb.net to create this
output file but i'm not sure if .NET has any tools to make the coding more
organized and/or efficient. Right now the only way i can think to create
each segment is by hardcoding the different elements into a string. For
example, to create the N1 segment i'll do this:
Dim sN1 as string = "N1*IM*" & drv("importer_n ame") & "*" &
drv("consignee_ code") & "*" & drv("consignee_ name")
I would do this for each record. This looks a little clumsy and was
wondering if there's maybe a way to predefine these record layouts or create
a template or some sort which can be used to make things easier to read. I'm
used to working with Dibol where you can create record layouts for this kind
of stuff. Advice will be greatly appreciated. Thanks!
ISA*00* *00* *ZZ*SENDER *ZZ*CBP
*070822*0940*#* 00501*000000001 *0*T*:
GS*SF*SENDER*CB P*070822*0940*1 *Y*005010
ST*333*0001
BGN*00*1234567-8*20070822*1005 *LT**ET
V1*7777777***** **L*S
N9*FC*FLR
N7*SCA1*1234567
N7*SCA2*9876543
N1*IM*Importer* 93*99-999999900
N1*CN**93*99-999999900
N1*IU*SCA3
N9*BM*111111111 1
N1*IU*MAEU
N9*MB*222222222 2
N1*SE*SellerNam e1
N3*123 Seller Street
N4*SHENZHEN**51 8008*CN
N1*SE*SellerNam e2
N3*555 POS Avenue
N4*SHENZHEN**51 8008*CN
N1*BY*Buyer
N3*777 Buyer Boulevard
N4*Seattle*WA*9 8101*US
N1*ST*Buyer - Loc1
N3*555 Shipto Avenue
N4*Seattle*WA*9 8101*US
N1*X2*StuffingL oc
N3*333 StuffLoc Street
N4*SHENZHEN**51 8008*CN
N1*CS*Consolida torName
N3*999 Consolidator Court
N4*SHENZHEN**51 8008*CN
N1*ST*Buyer - Loc2
N3*987 Shipto Street
N4*Indianapolis *IN*98101*US
N1*MF*Manufactu rerName1
N3*1357 Manufacturer Way
N4*SHENZHEN**51 8008*CN
TC2*A*HTSCD1
N1*CT*China*38* CN
TC2*A*HTSCD2
N1*CT*China*38* CN
N1*MF*Manufactu rerName2
N3*555 Maker's Street
N4*TSIM SHA TSUI EAST KOWLOON***HK
TC2*A*HTSCD3
N1*CT*Hong Kong*38*HK
SE*46*0001
GE*1*1
IEA*1*000000001
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Dario de Judicibus |
last post by:
I wish to create two simple layouts by using only HTML, CSS and the minimum
JavaScript as possible. Layouts should be "elastic" (no fixed widths and
heights) and cross-browser enabled.
The first one is a non-scrollable page which contains a centered title and a
centered division with automatic scrolling on overflow, that is:
+---------------------+
| TITLE |
| +--------------++ |
|
by: Alan J. Flavell |
last post by:
A colleague recently breezed in with a new web page design. He
didn't tell me where he got the ideas from, but ...
Looking at his stylesheets, I noticed they identified themselves
as "Ruthsarian Layouts". Google took me to
http://webhost.bridgew.edu/etribou/layouts/
We don't seem to have had any discussion here that mentioned them.
Anyone care to take a look, and share thoughts?
|
by: William Wisnieski |
last post by:
Hello Everyone:
I'm having a very strange problem occurring with my Access 2000 database. I
call it the "mystery record."
Here's the story:
I have a query by form that returns a record set in a datasheet. The user
double clicks on a row in that datasheet and a main form (pop up) opens
bound to a table with a continuous subform bound to a query.
|
by: Tim |
last post by:
I have used a graphic 'next record' button on a form. How can I stop it
from going past the last existing record? In other words, I don't want it
to take the user to a blank record.
Thanks
Tim
|
by: Lee-Anne Waters via AccessMonster.com |
last post by:
Hello,
i have just upgraded my database from access 97 to access 2000 and updated all the jet paks. however when i use my import functions to import orders (.csv) one order will appear as a group of small boxes or really funny writing. if i go to delete the record it gives me this message
the search key was not found in any record
if i log all users out and repair i can delete it but i would not want to do that each time
has anyone...
| |
by: vanvee |
last post by:
Hi
I am trying to program a VB.Net Windows application (in a client server
environment with multiple users) and am seeking some help about a
possible technique to handle concurreny issues. I am using ADO.Net,
typed datasets, and data binding through code. Is there any way that
when a user pulls out a record (and this user could only pull one
record at a time) into his local dataset, that a flag can be sent back
to the server for that...
|
by: domcatanzarite |
last post by:
How would one create a button that on click advances the form to the
next "non recurring record" as opposed to the next record.
The field the button needs to que from has groups of duplicate values.
I need it to advance the form to the next group of duplicate values not
just the next record.
|
by: AA Arens |
last post by:
I my form I have put record navigation buttons. When I choose just
before the last record, the "Go to next record" button, access
automatically start with a new record instead of a message that theere
are no records after.
I do have a command that automatically jumps to the last record after I
open the form:
Private Sub Form_Load()
DoCmd.GoToRecord , , acLast
|
by: tekctrl |
last post by:
Anyone:
I have a simple MSAccess DB which was created from an old ASCII flatfile.
It works fine except for something that just started happening. I'll enter
info in a record, save the record, and try to move to another record and get
an Access error "Record is too large". The record is only half filled, with
many empty fields. If I remove the added data or delete some older data,
then it saves ok and works fine again. Whenever I'm...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |